Histogram backprojection

184 views
Skip to first unread message

abid rahman

unread,
Apr 9, 2013, 12:40:26 PM4/9/13
to scikit...@googlegroups.com
Hi,

I would like to add a feature on histogram backprojection as proposed by Swain & Michael J. in their paper "Indexing via color histograms".. Earlier, I had written a simple article on that ( it was focussed for OpenCV) in my blog : http://opencvpython.blogspot.in/2013/03/histograms-4-back-projection.html.

I can have some simple modification to it to integrate it into scikit-image. So I would like to know the opinion of senior developers on this proposal.

Regards
Abid K.

Stéfan van der Walt

unread,
Apr 9, 2013, 12:48:03 PM4/9/13
to scikit-image
Hi Abid

On Tue, Apr 9, 2013 at 6:40 PM, abid rahman <abidr...@gmail.com> wrote:
> I would like to add a feature on histogram backprojection as proposed by
> Swain & Michael J. in their paper "Indexing via color histograms".. Earlier,
> I had written a simple article on that ( it was focussed for OpenCV) in my
> blog :
> http://opencvpython.blogspot.in/2013/03/histograms-4-back-projection.html.

For some reason, I get a blank blog entry page when I try to load
that. Can anyone else see it?

Stéfan

Puneeth Chaganti

unread,
Apr 9, 2013, 12:49:38 PM4/9/13
to scikit...@googlegroups.com
It takes a short while (~20s?) to load. But, I can see it.

abid rahman

unread,
Apr 9, 2013, 12:51:41 PM4/9/13
to scikit...@googlegroups.com
Sorry about that. I don't know what is the problem. It works fine for me.

Please try base url : www.opencvpython.blogspot.in


On Tue, Apr 9, 2013 at 10:18 PM, Stéfan van der Walt <ste...@sun.ac.za> wrote:

--
You received this message because you are subscribed to the Google Groups "scikit-image" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.





--
Abid K.

Stéfan van der Walt

unread,
Apr 9, 2013, 12:56:52 PM4/9/13
to scikit-image
On Tue, Apr 9, 2013 at 6:51 PM, abid rahman <abidr...@gmail.com> wrote:
>> > http://opencvpython.blogspot.in/2013/03/histograms-4-back-projection.html.

I got hold of it now, thanks. That looks very interesting, as does

http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.132.5942

We look forward to your pull request! Let us know if you need any help.

Regards
Stéfan

abid rahman

unread,
Apr 9, 2013, 2:37:28 PM4/9/13
to scikit...@googlegroups.com
Hi,

I ran into a problem with scikit installation in windows 7. I am using python 2.7 32 bit. python setup.py install shows error : Unable to find vcvarsall.bat.

Any idea what it is? I googled and tried a lot of hacks, but still the same error. Any idea what it is?

Meanwhile, I will switch into Fedora for backprojection work !!!

Regards

abid rahman

unread,
Apr 10, 2013, 7:13:52 AM4/10/13
to scikit...@googlegroups.com
Doesn't scikit-image has a 2d convolution function like cv2.filter2D in OpenCV which enables convolution of an image (or any numpy array) with custom kernel ?

Josh Warner

unread,
Apr 10, 2013, 8:35:19 PM4/10/13
to scikit...@googlegroups.com
The message Unable to find vcvarsall.bat means it's looking for the Visual C++ compiler and can't find it installed.  If you want to develop on Windows, I believe this compiler is freely available in Visual Studio 2008.

Some all-in-one distributions use workarounds for different compilers on Windows, commonly mingw32 (Python(x,y) uses this option), or pre-compiled binaries (the most used set I'm aware of is provided by Christopher Gohlke: http://www.lfd.uci.edu/~gohlke/pythonlibs/) though you obviously can't easily develop using a precompiled binary.

Personally, I think you'll be happier all around if you develop on a *NIX like Fedora, Ubuntu, Linux Mint, or Scientific Linux.

Josh Warner

unread,
Apr 10, 2013, 8:38:12 PM4/10/13
to scikit...@googlegroups.com
I believe we generally leverage the convolution tools in `scipy.ndimage`. On a high level, the scikit-image project is an extension toolkit for SciPy so we generally* don't reinvent the wheel.

* there are always exceptions.

abid rahman

unread,
Apr 10, 2013, 10:12:17 PM4/10/13
to scikit...@googlegroups.com
Hi Josh Warner,

Thanks for both your replies.

It is fine with Fedora. I have started the work

And In that case I will go on with SciPy functions available.

But it makes another question : If scipy.ndimage is there and scikit is using scipy, what is the need of scikit-image ? scipy.ndimage itself is a good library.

Regards


--
You received this message because you are subscribed to the Google Groups "scikit-image" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Tony Yu

unread,
Apr 10, 2013, 11:53:17 PM4/10/13
to scikit...@googlegroups.com
On Wed, Apr 10, 2013 at 9:12 PM, abid rahman <abidr...@gmail.com> wrote:
But it makes another question : If scipy.ndimage is there and scikit is using scipy, what is the need of scikit-image ? scipy.ndimage itself is a good library.

Hi Abid,

You should think of `scikit-image` as a complement to `scipy.ndimage`: `scikit-image` adds additional capabilities to what is provided by `scipy.ndimage`. In fact, the maintainers of `scipy.ndimage` are Stefan van der Walt, the creator of `scikit-image`, and Thouis (Ray) Jones, a frequent contributor.

Part of the rationale for the development of scikits (not just `scikit-image`) was a faster, independent development cycle. This has allowed the SciPy Stack (I think that's the tentative name for the entire scientific python ecosystem, not just `scipy` the package) to grow much faster than before.

Cheers,
-Tony

Jérôme Kieffer

unread,
Apr 11, 2013, 2:49:18 PM4/11/13
to scikit...@googlegroups.com
On Wed, 10 Apr 2013 04:13:52 -0700 (PDT)
abid rahman <abidr...@gmail.com> wrote:

> Doesn't scikit-image has a 2d convolution function like cv2.filter2D in
> OpenCV which enables convolution of an image (or any numpy array) with
> custom kernel ?

Convolution can be done in Fourier space, especially if the kernel is large ... I do that often, especially on nvidia GPU where FFT is for free.

I will have a trainee working on more generic 2D convolutions using OpenCL, this summer.

Cheers,

--
Jérôme Kieffer <goo...@terre-adelie.org>

Stéfan van der Walt

unread,
Apr 11, 2013, 5:41:35 PM4/11/13
to scikit-image

On Apr 11, 2013 8:49 PM, "Jérôme Kieffer" <goo...@terre-adelie.org> wrote:
>
> On Wed, 10 Apr 2013 04:13:52 -0700 (PDT)
> abid rahman <abidr...@gmail.com> wrote:
>
> > Doesn't scikit-image has a 2d convolution function like cv2.filter2D in
> > OpenCV which enables convolution of an image (or any numpy array) with
> > custom kernel ?
>
> Convolution can be done in Fourier space, especially if the kernel is large ... I do that often, especially on nvidia GPU where FFT is for free.

SciPy also provides fftconvolve, for what it's worth.

Looking forward to seeing those opencl codes! (We have to reopen the backend discussion soon)

Stéfan

Jérôme Kieffer

unread,
Apr 13, 2013, 2:44:23 AM4/13/13
to scikit...@googlegroups.com
On Thu, 11 Apr 2013 23:41:35 +0200
Stéfan van der Walt <ste...@sun.ac.za> wrote:

> On Apr 11, 2013 8:49 PM, "Jérôme Kieffer" <goo...@terre-adelie.org> wrote:
> >
> > On Wed, 10 Apr 2013 04:13:52 -0700 (PDT)
> > abid rahman <abidr...@gmail.com> wrote:
> >
> > > Doesn't scikit-image has a 2d convolution function like cv2.filter2D in
> > > OpenCV which enables convolution of an image (or any numpy array) with
> > > custom kernel ?
> >
> > Convolution can be done in Fourier space, especially if the kernel is
> large ... I do that often, especially on nvidia GPU where FFT is for free.
>
> SciPy also provides fftconvolve, for what it's worth.

I was surprised to figure out that fftpack (from numpy) can be faster than fftw depending on the input size...
I guess it is not more than: numpy.fft.ifft2(numpy.fft.fft2(A)*numpy.fft.fft2(B).conjuguate())

> Looking forward to seeing those opencl codes! (We have to reopen the
> backend discussion soon)

If cuda is an option, then I have implementations based on cufft which are really efficient (but most of us could do it so trivial it is). I consider openCL is both cleaner and more promising for open source (even if less easy)

abid rahman

unread,
Apr 16, 2013, 9:54:46 AM4/16/13
to scikit...@googlegroups.com
Hi,

I have sent a pull request for Histogram backprojection ( sorry for being a little late, It is "exam season" for me in this month). Please review the request and let me know if any modifications to be done ( as this is my first pull request to scikit-image)

Regards


On Tuesday, 9 April 2013 22:10:26 UTC+5:30, abid rahman wrote:

Stéfan van der Walt

unread,
Apr 16, 2013, 4:50:57 PM4/16/13
to scikit-image
Hi Abid

On Tue, Apr 16, 2013 at 3:54 PM, abid rahman <abidr...@gmail.com> wrote:
> I have sent a pull request for Histogram backprojection ( sorry for being a
> little late, It is "exam season" for me in this month). Please review the
> request and let me know if any modifications to be done ( as this is my
> first pull request to scikit-image)

Thanks for the PR! As you'll notice, you've already had feedback from
two of us. We typically use the PR as a place to converse about the
code until it reaches a state where it can be incorporated into the
project.

Stéfan

abid rahman

unread,
Apr 16, 2013, 11:53:41 PM4/16/13
to scikit...@googlegroups.com
I am sorry, what does PR means ? Never heard before.


--
You received this message because you are subscribed to the Google Groups "scikit-image" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Stéfan van der Walt

unread,
Apr 17, 2013, 12:54:34 AM4/17/13
to scikit-image

On Apr 17, 2013 5:53 AM, "abid rahman" <abidr...@gmail.com> wrote:
>
> I am sorry, what does PR means ? Never heard before.

It stands for "pull request".

Stéfan

Reply all
Reply to author
Forward
0 new messages