@Reference(type=Inproceedings, author={"Bosch, Anna","Zisserman, Andrew","Munoz, Xavier"}, title="Representing shape with a spatial pyramid kernel", year="2007", booktitle="Proceedings of the 6th ACM international conference on Image and video retrieval", pages={"401","","408"}, url="http://doi.acm.org/10.1145/1282280.1282340", publisher="ACM", series="CIVR \'07", customData={"isbn","978-1-59593-733-9","location","Amsterdam, The Netherlands","numpages","8","doi","10.1145/1282280.1282340","acmid","1282340","address","New York, NY, USA","keywords","object and video retrieval, shape features, spatial pyramid kernel"}) public class PHOG extends Object implements ImageAnalyser<FImage>, FeatureVectorProvider<DoubleFV>
In the original description, only orientations at edge pixels were counted; that restriction is optional in this implementation. If only edge pixels are used, then the feature describes the distribution of shape in the image. Conversely, if all pixels are used, the feature essentially describes the texture of the image.
As this class will typically be used to only construct a single feature from
an image, it is built around a BinnedWindowedExtractor
(or
InterpolatedBinnedWindowedExtractor
if interpolation is used). This
will be much more efficient than a
GradientOrientationHistogramExtractor
in the single window case. If
you do need to extract many PHOG-like features different rectangles of the
same image, use a GradientOrientationHistogramExtractor
coupled with
a QuadtreeStrategy
to achieve the desired effect.
Constructor and Description |
---|
PHOG()
Construct with the values used in the paper: 4 levels (corresponds to l=3
in the paper), 40 orientation bins (interpolated), signed gradients
(called "shape360" in the original paper) and Canny edge detection.
|
PHOG(int nlevels,
int nbins,
boolean histogramInterpolation,
FImageGradients.Mode orientationMode,
ImageProcessor<FImage> edgeDetector)
Construct with the given parameters.
|
PHOG(int nlevels,
int nbins,
FImageGradients.Mode orientationMode)
Construct with the given values, using Canny edge detection and gradient
histogram interpolation.
|
Modifier and Type | Method and Description |
---|---|
void |
analyseImage(FImage image)
Analyse an image.
|
Histogram |
getFeatureVector()
Extract the PHOG feature for the whole of the image last analysed with
analyseImage(FImage) . |
Histogram |
getFeatureVector(Rectangle rect)
Extract the PHOG feature for the specified region of the image last
analysed with
analyseImage(FImage) . |
public PHOG()
public PHOG(int nlevels, int nbins, FImageGradients.Mode orientationMode)
nlevels
- number of pyramid levels (note this includes l0, so you might
need 1 more)nbins
- number of binsorientationMode
- the orientation modepublic PHOG(int nlevels, int nbins, boolean histogramInterpolation, FImageGradients.Mode orientationMode, ImageProcessor<FImage> edgeDetector)
edgeDetector
parameter can be null
if you don't want to filter out
non-edge pixels from the histograms.nlevels
- number of pyramid levels (note this includes l0, so you might
need 1 more)nbins
- number of binshistogramInterpolation
- should the gradient orientations be interpolated?orientationMode
- the orientation modeedgeDetector
- the edge detector to use (may be null
for
gradient features)public void analyseImage(FImage image)
ImageAnalyser
analyseImage
in interface ImageAnalyser<FImage>
image
- The image to process in place.public Histogram getFeatureVector(Rectangle rect)
analyseImage(FImage)
.rect
- the regionpublic Histogram getFeatureVector()
analyseImage(FImage)
.getFeatureVector
in interface FeatureVectorProvider<DoubleFV>
FeatureVectorProvider.getFeatureVector()