that's an excellent question, and not a troll :-). Opencv is a
very powerful library, but it focuses primarily on computer vision
(feature detection and extraction, classification, ...), as opposed to
image processing in general (with other tasks such as denoising,
The other big difference is that skimage builds on numpy
ndarrays, and uses the full power of the numpy API (including of course
the basic facilities for processing arrays as images that come with
numpy), as well as some of scipy functions (you could have added
scipy.ndimage to your list -- a few functions in skimage are wrappers
around scipy.ndimage, that exist for the sake of completeneness). One
important consequence is that algorithms working for 3-d or even n-d
images can be easily implemented in 3-d/n-d in skimage, whereas opencv is
restricted to 2-D images (as far as I know). Thanks to the use of numpy
arrays, the API of skimage is also quite pleasant for a numpy user, more
than the API of opencv.
A related difference is that skimage is written in python and
cython, whereas opencv is a C++ library. The two libraries attract a
different crowd of developers, and a Python/Cython toolkit based on numpy
arrays is easier to develop and maintain inside the Scientific Python
I'm sure that other devs/users will have things to add to this
On Thu, Dec 27, 2012 at 02:06:08PM -0800, FranÃ¯Â¿Â½ois wrote:
> Hi users and devs,
> It came to my knowledge that another python library (based on C++ and C
> codes) for image processing exists too : opencv
> I understand that numpy intregrates some basic features and we need some
> advanced features but I have the feeling that skimages is redoundant with
> opencv in some ways.
> What's the position of skimage about that? (Don't read this question as a
> troll but like a real question).
> I mean that similar features exist in both. Would not be possible to
> reuse/integrate opencv or merge? what's the reason for keeping them apart?
> My observation is there is 4 libraries to manipulate images:
> * PIL
> * numpy
> * skimages
> * opencv
> That's a lot.
I've been implementing my own HoG transform looking at different sources.
While the implementation in scikit-image seems to lack certain features
(multiple normalization schemes, general block overlap, Gaussian block
window, trillinear interpolation/weighting of bin assignments,...) these
don't seem to be that important, at least when applied to my current
problem (eye blink analysis).
Most of these would increase complexity, giving the implementation a
complicated look, with little gain. I've also been looking into some
practical improvements - integral histogram, separating the cell-block
histogram feature to use it with other dense feature transforms such as
LBP, a HoG visualization function that would render the visualization at
higher resolutions that the original image.
Would any of these be welcomed additions to scikit-image?
A while ago I wrote a post on my blog with code on how to import in Python
a colour palette in an ASCII file and convert it to a Matplotlib colormap:
Following that post I wrote a tutorial on a geoscience magazine on how to
evaluate and compare colormaps using Python:
In the accompanying notebook I show how to convert a 256x3 RGB colormap to
a 256x256x3 RGB image, then convert it to CIELAB using scikit-image's
rgb2lab, then plot the 256x1 lightness (L) array to evaluate the colormaps
You can read the relevant extract of the notebook using this nbviewer link:
In that case scikit-image worked really well for me.
Now I am trying to follow up with a new tutorial and I run into problems
with the color space conversions.
You can follow what I am trying to do in this other notebook extract:
The goal of this new tutorial is to show how to build colormaps from
scratch using perceptual principles. I design a color palette in LCH (polar
version of CIELAB) by keeping Chroma and Lightness fixed and interpolating
Hue around the circle, then convert to LAB, then to RGB.
As far as I know the code I wrote should work, but the result is a black
colormap. I am thinking I got wrong one or more of the ranges for the LCH
coordinates. I assumed L between (0,1), Ch between (0,1), and H between (0,
Is that wrong, and if that's the case, what are the ranges? Many of them
are not stated clearly in the documentation in here:
Is it possible to update the documentation to clearly state all ranges for
all colour spaces.
Thanks for your help.
I am trying to make pairs of images from the following set of images
(chromosomes sorted by size after rotation). The idea is to make a feature
vector for unsupervised classification (kmeans with 19 clusters)
>From each chromosome an integral image was calculated:
plt.figure(figsize = (15,15))
gs1 = gridspec.GridSpec(6,8)
gs1.update(wspace=0.0, hspace=0.0) # set the spacing between axes.
for i in range(38):
# i = i + 1 # grid spec indexes from 0
ax1 = plt.subplot(gs1[i])
image = sk.transform.integral_image(reallysorted[i][:,:,2])
imshow(image , interpolation='nearest')
Then each integral image was flatten and combined with the others:
for i in range(38):
X = np.asarray(Features)
The X array contains *38* lines and 9718 features, which is not good.
However, I trried to submit these raw features to kmeans classification
with sklearn using a direct example
from sklearn.neighbors import NearestNeighbors
nbrs = NearestNeighbors(n_neighbors=*19*, algorithm='ball_tree').fit(X)
distances, indices = nbrs.kneighbors(X)
connection = nbrs.kneighbors_graph(X).toarray()
Ploting the connection graph shows that a chromosomes is similar to more
than one ...
- Do you think that integral images can be used to discriminate the
- If so, how to reduce the number of features to 10~20? (to get a better
Thanks for your advices.
Just wanted to mention an algorithm which I was very impressed by and
which might be an awesome addition to scikit-image. The algorithm is
called COSFIRE (Combination of Shifted Filter Responses).
I saw a talk by Geore Azzopardi, who presented the use of the algorithm
for object and patter recognition. I was very impressed with the quality
of segmentation of the shown examples, but also with the wide variety of
image data (e.g. retina images, traffic signs, hand-written characters,
The filter is inspired by how the brain processes visual information,
and according to the author the algorithm is actually quite simple. The
algorithm was the topic of his PhD and he's going to continue working on
it in his new job.
The code (in Matlab) is available, so it might be worth a shot to try
and port it to Python.
- PhD thesis: http://www.cs.rug.nl/~george/phd-thesis/
- Matlab code: nl.mathworks.com/matlabcentral/fileexchange/37395
- Paper in MIA:
I'm pleased to announce version 1.0 of imageio - a library for reading
and writing images. This library started as a spin-off of the freeimage
plugin in skimage, and is now a fully-fledged library with unit tests
Imageio provides an easy interface to read and write a wide range of
image data, including animated images, volumetric data, and scientific
formats. It is cross-platform, runs on Python 2.x and 3.x, and is easy
Imageio is plugin-based, making it easy to extend. It could probably use
more scientific formats. I welcome anyone who's interested to contribute!
install: pip install imageio
release notes: http://imageio.readthedocs.org/en/latest/releasenotes.html
I am pleased to see interest in the COSFIRE approach that I started during
my PhD studies.
The COSFIRE approach is a trainable pattern recognition approach which can
be applied to several applications, including feature detection, object
recognition and localization, image classification, contour detection and
vessel segmentation. The selectively for a pattern of interest is
automatically configured in a training process. The method involves several
computations that are independent of each other, and thus it can be easily
implemented using parallel programming (e.g. on a GPU). The original paper
(http://www.cs.rug.nl/~george/articles/PAMI2013.pdf) combines information
about the contours of the concerned pattern. We now have another paper
which is currently being reviewed for CVPR2015 where we show that by adding
colour information COSFIRE filters become even more robust.
Please feel free to send me other ideas on how this work can be developed
I would be very happy and available to work with an undergraduate or a
postgraduate student (or any other person) to have this parallel
implementation in Python. I see that you already added it to the
Requested-features page. You can also add my contact details (geazzo@gmail)
there for the interested readers.
All my papers can be freely downloaded from my
On Tuesday, 16 December 2014 15:22:45 UTC+1, Stefan van der Walt wrote:
> On Tue, Dec 16, 2014 at 1:57 PM, Pratap Vardhan <prat...(a)gmail.com
> > I found few copies of the paper hosted by universities. I haven't
> checked if
> > these are the actual pre-prints - However, by the citation it looks like
> Thanks! I've added it to the list:
I have recently been attempting to modify some existing skimage code to
display regionprops for a labeled image (e.g. area or eccentricity)
I initially tried to translate a vectorized bit of old matlab code I had,
but gave up on that and decided to alter the existing label2rgb skimage
I am attempting to change each label value to it's area property value
similar to the label2rgb "avg" function.
so I have:
labels = a labeled image
out = np.zeros_like(labels) #a blank array
labels2 = np.unique(labels) #a vector of label vals
out = np.zeros_like(labels)
Props = regionprops(labels, ['Area'])
bg = (labels2 == bg_label)
labels2 = labels2[labels2 != bg_label]
out[bg] = 0
for label in labels2:
mask = (labels == label).nonzero()
color = Props[label].area
out[mask] = color
but the "out" props image does not correspond to the correct area values?
Can anyone help me with this?
It also throws the following error:
"list index out of range"
It would certainly be useful to have a way to view the spatial distribution
of label properties in this way - perhaps in a future skimage version?
I am attempting this install on Windows with
>pip install .
as per the instructions.
The last compiler I have access to, is Visual Studio 10, so according to
scikit-learn, and digging through the compiler script, it should be the
last one recognized for .dll compilation before Python 3.5.
I have the following errors right at the end of the build. This is under a
fresh Anaconda install, with all the packages updated.
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe /c
/nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Anaconda3\lib\core\include
-IC:\Anaconda3\include -IC:\Anaconda3\include /Tcskimage\_shared\geometry.c
Found executable C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\
282: UserWarning: Normalizing '0.11dev' to '0.11.dev
error: Command "C:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG
/Fobuild\temp.win-amd64-3.4ared\geometry.obj" failed with exit status 2
C:\Anaconda3\include\pyconfig.h(68) : fatal error C1083: Cannot open
include file: 'io.h': No such file or directory
Rolling back uninstall of scikit-image
Command "C:\Anaconda3\python.exe -c "import setuptools,
'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))"
install --record C:\cygwin64\tmp\pip-xqr2l87y-recor
--single-version-externally-managed --compile" failed with error code 1 in