Package gov.nih.mipav.model.algorithms
Class HistogramOfOrientedGradients
- java.lang.Object
- 
- java.lang.Thread
- 
- gov.nih.mipav.model.algorithms.AlgorithmBase
- 
- gov.nih.mipav.model.algorithms.HistogramOfOrientedGradients
 
 
 
- 
- All Implemented Interfaces:
- java.awt.event.ActionListener,- java.awt.event.WindowListener,- java.lang.Runnable,- java.util.EventListener
 
 public class HistogramOfOrientedGradients extends AlgorithmBase Copyright (C) 2007-11, Andrea Vedaldi and Brian Fulkerson Copyright (C) 2012-13, The VLFeat Team All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description (package private) classHistogramOfOrientedGradients.tImage(package private) classHistogramOfOrientedGradients.VlHog(package private) static classHistogramOfOrientedGradients.VlHogVariant
 - 
Field SummaryFields Modifier and Type Field Description private ModelImageimage- 
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBasedestFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
 
- 
 - 
Constructor SummaryConstructors Constructor Description HistogramOfOrientedGradients()HistogramOfOrientedGradients(ModelImage image)
 - 
Method Summary- 
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBaseactionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, finalize, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, generateProgressValues, getDestImage, getElapsedTime, getMask, getMaxProgressValue, getMinProgressValue, getNumberOfThreads, getProgress, getProgressChangeListener, getProgressChangeListeners, getProgressModulus, getProgressStep, getProgressValues, getSrcImage, isCompleted, isImage25D, isMultiThreadingEnabled, isRunningInSeparateThread, isThreadStopped, linkProgressToAlgorithm, linkProgressToAlgorithm, makeProgress, notifyListeners, removeListener, removeProgressChangeListener, run, setCompleted, setImage25D, setMask, setMaxProgressValue, setMinProgressValue, setMultiThreadingEnabled, setNumberOfThreads, setProgress, setProgressModulus, setProgressStep, setProgressValues, setProgressValues, setRunningInSeparateThread, setSrcImage, setStartTime, setThreadStopped, startMethod, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
 - 
Methods inherited from class java.lang.ThreadactiveCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
 
- 
 
- 
- 
- 
Field Detail- 
imageprivate ModelImage image 
 
- 
 - 
Constructor Detail- 
HistogramOfOrientedGradientspublic HistogramOfOrientedGradients() 
 - 
HistogramOfOrientedGradientspublic HistogramOfOrientedGradients(ModelImage image) 
 
- 
 - 
Method Detail- 
vl_hog_newpublic HistogramOfOrientedGradients.VlHog vl_hog_new(HistogramOfOrientedGradients.VlHogVariant variant, int numOrientations, boolean transposed) - Parameters:
- variant- HOG descriptor variant.
- numOrientations- number of distinguished orientations.
- transposed- wether images are transposed (column major).
- Returns:
- the new HOG object. The function creates a new HOG object to extract descriptors of the prescribed @c variant. The angular resolution is set by
 
 - 
vl_hog_deletepublic void vl_hog_delete(HistogramOfOrientedGradients.VlHog self) - Parameters:
- self- HOG object to delete.
 
 - 
vl_hog_get_glyph_sizepublic int vl_hog_get_glyph_size(HistogramOfOrientedGradients.VlHog self) - Parameters:
- self- HOG object.
- Returns:
- size (height and width) of a glyph.
 
 - 
vl_hog_get_permutationpublic int[] vl_hog_get_permutation(HistogramOfOrientedGradients.VlHog self) - Parameters:
- self- HOG object.
- Returns:
- left-right permutation.
 The function returns a pointer to an array @c permutation of ::vl_hog_get_dimension
 elements. Given a HOG descriptor (for a cell) @c hog, which is also
 a vector of ::vl_hog_get_dimension elements, the
 descriptor obtained for the same image flipped horizotnally is
 given by flippedHog[i] = hog[permutation[i]].
 
 - 
vl_hog_set_use_bilinear_orientation_assignmentspublic void vl_hog_set_use_bilinear_orientation_assignments(HistogramOfOrientedGradients.VlHog self, boolean x) - Parameters:
- self- HOG object.
- x-
 
 - 
vl_hog_get_use_bilinear_orientation_assignmentspublic boolean vl_hog_get_use_bilinear_orientation_assignments(HistogramOfOrientedGradients.VlHog self) - Parameters:
- self- HOG object.
- Returns:
 
 - 
vl_hog_renderpublic void vl_hog_render(HistogramOfOrientedGradients.VlHog self, float[] image, float[] descriptor, int height, int width) - Parameters:
- self- HOG object.
- image- glyph image (output).
- descriptor- HOG descriptor.
- width- HOG descriptor width.
- height- HOG descriptor height. The function renders the HOG descriptor or filter
 
 - 
vl_hog_get_dimensionpublic int vl_hog_get_dimension(HistogramOfOrientedGradients.VlHog self) - Parameters:
- self- HOG object.
- Returns:
- dimension of a HOG cell descriptors.
 
 - 
vl_hog_get_widthpublic int vl_hog_get_width(HistogramOfOrientedGradients.VlHog self) - Parameters:
- self- HOG object.
- Returns:
- number of HOG cells in the horizontal direction.
 
 - 
vl_hog_get_heightpublic int vl_hog_get_height(HistogramOfOrientedGradients.VlHog self) - Parameters:
- self- HOG object.
- Returns:
- number of HOG cells in the vertical direction.
 
 - 
vl_hog_prepare_bufferspublic void vl_hog_prepare_buffers(HistogramOfOrientedGradients.VlHog self, int width, int height, int cellSize) - Parameters:
- self- HOG object.
- width- image width.
- height- image height.
- cellSize- size of a HOG cell.
 
 - 
vl_hog_put_imagepublic void vl_hog_put_image(HistogramOfOrientedGradients.VlHog self, float[] image, int height, int width, int numChannels, int cellSize) - Parameters:
- self- HOG object.
- image- image to process.
- width- image width.
- height- image height.
- numChannels- number of image channles.
- cellSize- size of a HOG cell. The buffer @c hog must be a three-dimensional array. The first two dimensions are @c (width + cellSize/2)/cellSize and
 
 - 
vl_hog_put_polar_fieldpublic void vl_hog_put_polar_field(HistogramOfOrientedGradients.VlHog self, float[] modulus, float[] angle, boolean directed, int height, int width, int cellSize) - Parameters:
- self- HOG object.
- modulus- image gradient modulus.
- angle- image gradient angle.
- directed- wrap the gradient angles at 2pi (directed) or pi (undirected).
- width- image width.
- height- image height.
- cellSize- size of a HOG cell. The function behaves like ::vl_hog_put_image, but foregoes the internal computation of the gradient field, allowing the user to specify their own. Angles are measure clockwise, the y axis pointing downwards, starting from the x axis (pointing to the right).
 
 - 
vl_hog_extractpublic void vl_hog_extract(HistogramOfOrientedGradients.VlHog self, float[] features) - Parameters:
- self- HOG object.
- features- HOG features (output). This method is called after ::vl_hog_put_image or ::vl_hog_put_polar_field in order to retrieve the computed HOG features. The buffer @c features must have the dimensions returned by ::vl_hog_get_width, ::vl_hog_get_height, and ::vl_hog_get_dimension.
 
 - 
setuppublic HistogramOfOrientedGradients.tImage setup() 
 - 
test_basic_callpublic void test_basic_call() 
 - 
test_bilinear_operationspublic void test_bilinear_operations() 
 - 
test_variants_and_flippingpublic void test_variants_and_flipping() 
 - 
test_polarpublic void test_polar() 
 - 
vl_hogpublic float[][][] vl_hog(float[][][] image, int cellSize, boolean bilinearOrientations, HistogramOfOrientedGradients.VlHogVariant variant, int numOrientations, boolean directedPolarField, boolean undirectedPolarField)
 - 
vl_hogpublic float[][][] vl_hog(float[][] image, int cellSize, boolean bilinearOrientations, HistogramOfOrientedGradients.VlHogVariant variant, int numOrientations)
 - 
vl_hog_permutationpublic int[] vl_hog_permutation(HistogramOfOrientedGradients.VlHogVariant variant, int numOrientations) 
 - 
vl_hog_renderpublic float[][] vl_hog_render(float[][][] descriptor, HistogramOfOrientedGradients.VlHogVariant variant, int numOrientations)
 - 
vl_demo_hogpublic void vl_demo_hog() 
 - 
runAlgorithmpublic void runAlgorithm() Description copied from class:AlgorithmBaseActually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
- runAlgorithmin class- AlgorithmBase
 
 
- 
 
-