really really Awesome post. — A paw detection using Python ndimage.
Here’s some interesting link I found from ‘ IMAGE AND VISUAL REPRESENTATION GROUP IVRG ‘
1. The free book of ‘joy of visual perception‘
2.CVonline: Vision Related Books including Online Books and Book Support Sites
Their algorithm: Radhakrishna Achanta and Sabine Susstrunk, Saliency Detection using Maximum Symmetric Surround, International Conference on Image Processing (ICIP), Hong Kong, September 2010.
is dealing with the problem of “salient regions comprise more than half the pixels of the image, or if the background is complex, the background gets highlighted instead of the salient object. “. Tested on several images, though not working for all cases, but it’s quite a nice saliency detection since it dose avoid some problems by most of the saliency detection — focusing mostly on high frequency, dense edge region.
Also, it seem that a website is built based on their research for automatically cropping image to give the best composition.
There are actually two steps in Mean-shift image segmentation: mean-shift filtering and then some merging and eliminating for segmentation. here’s a paper well states the process. I found it quite clear and easy to understand. Below are some notes on Mean Shift Segmentation.
1. Based on non-parametric density estimation, no assumptions about probability distributions, and no restriction on the spatial window size (which is different from bi-lateral filtering)
2. Spatial-range joint domain (x, y, f(x, y)), spatial domain refers to image spatial coordinates, while range domain refers to image dimension, such as gray image (1), rgb color image (3), etc
3. Finds the maximm in the (x, y, f) space, clusters close in both space and range correspond to classes.
4. The 3 parameters (such in EDISON) are :
sigmaS: — normalization parameter for spatial
sigmaR — normalization parameter for range domain
minRegionSize — minimum size (lower bound) that a ‘region’ is declared as a class
To understand the two normalization parameter, sigmaS and sigmaR, think about the window size in the kernel function in the kernel density estimation. It controls the ‘range’ or say smoothness of the kernel, or how fast the kernel decays. Larger the normalization parameter is, it is smoother in the corresponding space( either spatial or range), or decays slower. A ZERO value corresponds to a delta function, which only concentrate on the center, i.e. the filtering output will be the same as the input, all details (each pixel) are remained. Larger sigmaS smoothes the spatial, while larger sigmaR smoothes the range (color domain). And from the results I obtain, singmaS is much more sensitive as compare to sigmaR.
The most well known open source for mean-shift, which is also very fast, is EDISON. If you want to use it in Matlab, there are also some wrappers.
Left: Original, Middle (4, 4, 5), Right: (10, 4, 5)
Here’s the wonderful imageJ <http://rsbweb.nih.gov/ij/plugins/index.html>
Sometimes, one can really learning something by just reading these fundamental algorithmes.
Here’s a nice comparison of different clustering method.
Here’s one that objective-C based image processing package.
I had tried several versions of install opencv on my mac that can be used in python.
Here are lessons — use the python provided by MacOS, you may have the following problem if you are using other versions.
– Use python by MacOS, which you should be able to finda and locate, e.g. the link /usr/bin/python (my version is Python 2.7)
I found that I can not use the python I installed somewhere else, such as </Library/Frameworks/Python.framework/Versions/2.7/>
– I used the brew to install opencv:
$sudo brew install opencv
It enventually install it to </usr/local/Cellar/opencv/2.3.1a>
– Next step, you need to add the path </usr/local/Cellar/opencv/2.3.1a/lib/python2.7/site-packages> to your PYTHONPATH
If you check the sit-packages folder, it should include two files: cv.py and cv2.so
So, change your ~/.profile to include the following line:
Otherwise, whenever you would like to import the cv, you will have to first include the path in your python code, something like this:
Now, time to do the test:
I couldn’t find the example folder of python by the package installed by brew.
So I went ahead and use the previous download one, which is a full package opencv:
$ls ~/Documents/OpenCV-2.3.1/samples/python (where you will be able to find the delaunay.py file, then go ahead to run it)
$ python ~/Documents/OpenCV-2.3.1/samples/python/delaunay.py
Nice , now it’s running, finally 🙂
ImageMagick is really a convenient tool for batch image process.
Install from here: http://www.imagemagick.org/script/index.php
For my installation I simply choose what they recommended: x86 dynamic version.
Now, able to batch resize use command like( this will resize all the jpg image under the current folder (overwrite the original one) with a rescale ratio %25 :
mogify -resize %25 *.jpg
Here’s a link with more information:
Use help to get all the command line functions provided.
$ mogrify -help
Usage: mogrify [options …] file [ [options …] file …]