Setting Gabor properties

38 views
Skip to first unread message

Ajay

unread,
Mar 7, 2014, 10:47:04 AM3/7/14
to jfeat...@googlegroups.com
Hi,

I want to extract features from an image for use in clustering.
I am using the Gabor filter to extract features.

It says on Wikipedia that a Gabor filter could yield lot of features for analysis of images. How do I change the frequencies and orientations of the Gabor filter?

ColorProcessor image = new ColorProcessor(ImageIO.read(imgFile));

Gabor descriptor = new Gabor();
descriptor.run(image);

List<double[]> featureList = descriptor.getFeatures();
featuresLine = Arrays.toString(featureList.get(0));

Thanks.

Franz Graf

unread,
Mar 13, 2014, 3:49:55 PM3/13/14
to jfeat...@googlegroups.com
Hi Aja,

I'm absolutely sorry that I couldn't respond earlier. I switched to a
new job and - well - it takes some time and energy. But let's get to
your question:

The Gabor feature extractor in JFeatureLib is a Wrapper for the
extractor provided in Lire project. You can call .getLireFeature() on
the Gabor object to get the Lire-instance:
https://code.google.com/p/lire/source/browse/trunk/src/main/java/net/semanticmetadata/lire/imageanalysis/Gabor.java?r=15

Then you can call all the methods of this class directly before starting
the extraction process.
Unfortunately I dare say that the fields you want to modify might be
private static final int S = 4, T = 4; // filter mask size
private static final int M = 5, N = 6; // scale & orientation
which are immuatbel in the Lire implementation :-(

So the only way to get it to work for you would be to copy the
Lire-Gabor class and make slight modifications so that you can set the
according fields.

Hope this helps,
Franz
> --
> You received this message because you are subscribed to the Google
> Groups "JFeatureLib" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to jfeaturelib...@googlegroups.com
> <mailto:jfeaturelib...@googlegroups.com>.
> To post to this group, send email to jfeat...@googlegroups.com
> <mailto:jfeat...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.


--
Dr. Franz Graf
Homepage: http://www.Locked.de
G+: https://plus.google.com/+FranzGraf

Ajay Bhat

unread,
Mar 14, 2014, 2:22:57 AM3/14/14
to jfeat...@googlegroups.com
Hi Franz,

I copied the Lire Gabor.java to package extensions, and the Gabor Wrapper from jfeatureLib to another package.

 private final extensions.Gabor gabor;

    public Gabor() {
        gabor = new extensions.Gabor();
    }

    @Override
    public void run(ImageProcessor ip) {
        firePropertyChange(Progress.START);
        gabor.extract(ip.getBufferedImage());
        addData(gabor.getData());
        firePropertyChange(Progress.END);
    }

I get an error for gabor.getData() not being defined. I couldn't find the method in either AbstractFeatureDescriptor (jFeatureLib) or LireFeature. Can you help me out?



To post to this group, send email to jfeat...@googlegroups.com

For more options, visit https://groups.google.com/d/optout.



--
Regards,
Ajay Bhat

Franz Graf

unread,
Apr 1, 2014, 3:44:04 PM4/1/14
to jfeat...@googlegroups.com
Hi Ajay,

sorry that it currently takes me so long to respond.
the lire-implementation doesn't have a getData() method.
Usually getDoubleHistogram is called on the lire features.
You can see the example in LireWrapper.java.

Does this help you a bit further?

Franz
> https://code.google.com/p/__lire/source/browse/trunk/src/__main/java/net/__semanticmetadata/lire/__imageanalysis/Gabor.java?r=15
> <https://code.google.com/p/lire/source/browse/trunk/src/main/java/net/semanticmetadata/lire/imageanalysis/Gabor.java?r=15>
>
> Then you can call all the methods of this class directly before
> starting the extraction process.
> Unfortunately I dare say that the fields you want to modify might be
> private static final int S = 4, T = 4; // filter mask size
> private static final int M = 5, N = 6; // scale & orientation
> which are immuatbel in the Lire implementation :-(
>
> So the only way to get it to work for you would be to copy the
> Lire-Gabor class and make slight modifications so that you can set
> the according fields.
>
> Hope this helps,
> Franz
>
>
> Am 07.03.2014 16:47, schrieb Ajay:
>
> Hi,
>
> I want to extract features from an image for use in clustering.
> I am using the Gabor filter to extract features.
>
> http://en.wikipedia.org/wiki/__Gabor_filter
> <http://en.wikipedia.org/wiki/Gabor_filter>
> It says on Wikipedia that a Gabor filter could yield lot of
> features for
> analysis of images. How do I change the frequencies and
> orientations of
> the Gabor filter?
>
> ColorProcessor image = new ColorProcessor(ImageIO.read(__imgFile));
>
> Gabor descriptor = new Gabor();
> descriptor.run(image);
>
> List<double[]> featureList = descriptor.getFeatures();
> featuresLine = Arrays.toString(featureList.__get(0));
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google
> Groups "JFeatureLib" group.
> To unsubscribe from this group and stop receiving emails from
> it, send
> an email to jfeaturelib+unsubscribe@__googlegroups.com
> <mailto:jfeaturelib%2Bunsu...@googlegroups.com>
> <mailto:jfeaturelib+...@googlegroups.com
> <mailto:jfeaturelib%2Bunsu...@googlegroups.com>>.
>
> To post to this group, send email to
> jfeat...@googlegroups.com <mailto:jfeat...@googlegroups.com>
> <mailto:jfeaturelib@__googlegroups.com
> <mailto:jfeat...@googlegroups.com>>.
>
> For more options, visit https://groups.google.com/d/__optout
> <https://groups.google.com/d/optout>.
>
>
>
> --
> Dr. Franz Graf
> Homepage: http://www.Locked.de
> G+: https://plus.google.com/+__FranzGraf
> <https://plus.google.com/+FranzGraf>
>
>
>
>
> --
> Regards,
> Ajay Bhat
>
> --
> You received this message because you are subscribed to the Google
> Groups "JFeatureLib" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to jfeaturelib...@googlegroups.com
> <mailto:jfeaturelib...@googlegroups.com>.
> To post to this group, send email to jfeat...@googlegroups.com
> <mailto:jfeat...@googlegroups.com>.
Reply all
Reply to author
Forward
0 new messages