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:
ActionListener,WindowListener,Runnable,EventListener
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 Summary
Nested ClassesModifier and TypeClassDescription(package private) class(package private) class(package private) static enumNested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsFields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStoppedFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoidActually runs the algorithm.setup()voidvoidvoidvoidvoidfloat[][][]vl_hog(float[][][] image, int cellSize, boolean bilinearOrientations, HistogramOfOrientedGradients.VlHogVariant variant, int numOrientations, boolean directedPolarField, boolean undirectedPolarField) float[][][]vl_hog(float[][] image, int cellSize, boolean bilinearOrientations, HistogramOfOrientedGradients.VlHogVariant variant, int numOrientations) voidvoidvl_hog_extract(HistogramOfOrientedGradients.VlHog self, float[] features) intintintint[]booleanintvl_hog_new(HistogramOfOrientedGradients.VlHogVariant variant, int numOrientations, boolean transposed) int[]vl_hog_permutation(HistogramOfOrientedGradients.VlHogVariant variant, int numOrientations) voidvl_hog_prepare_buffers(HistogramOfOrientedGradients.VlHog self, int width, int height, int cellSize) voidvl_hog_put_image(HistogramOfOrientedGradients.VlHog self, float[] image, int height, int width, int numChannels, int cellSize) voidvl_hog_put_polar_field(HistogramOfOrientedGradients.VlHog self, float[] modulus, float[] angle, boolean directed, int height, int width, int cellSize) float[][]vl_hog_render(float[][][] descriptor, HistogramOfOrientedGradients.VlHogVariant variant, int numOrientations) voidvl_hog_render(HistogramOfOrientedGradients.VlHog self, float[] image, float[] descriptor, int height, int width) voidMethods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, 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, windowOpenedMethods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Field Details
-
image
-
-
Constructor Details
-
HistogramOfOrientedGradients
public HistogramOfOrientedGradients() -
HistogramOfOrientedGradients
-
-
Method Details
-
vl_hog_new
public 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_delete
- Parameters:
self- HOG object to delete.
-
vl_hog_get_glyph_size
- Parameters:
self- HOG object.- Returns:
- size (height and width) of a glyph.
-
vl_hog_get_permutation
- 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_assignments
public void vl_hog_set_use_bilinear_orientation_assignments(HistogramOfOrientedGradients.VlHog self, boolean x) - Parameters:
self- HOG object.x- @c true if orientations should be assigned with bilinear interpolation.
-
vl_hog_get_use_bilinear_orientation_assignments
public boolean vl_hog_get_use_bilinear_orientation_assignments(HistogramOfOrientedGradients.VlHog self) - Parameters:
self- HOG object.- Returns:
- @c true if orientations are be assigned with bilinear interpolation.
-
vl_hog_render
public 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.height- HOG descriptor height. The function renders the HOG descriptor or filterwidth- HOG descriptor width.
-
vl_hog_get_dimension
- Parameters:
self- HOG object.- Returns:
- dimension of a HOG cell descriptors.
-
vl_hog_get_width
- Parameters:
self- HOG object.- Returns:
- number of HOG cells in the horizontal direction.
-
vl_hog_get_height
- Parameters:
self- HOG object.- Returns:
- number of HOG cells in the vertical direction.
-
vl_hog_prepare_buffers
public 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_image
public 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.height- image height.width- image width.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_field
public 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).height- image height.width- image width.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_extract
- 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.
-
setup
-
test_basic_call
public void test_basic_call() -
test_bilinear_operations
public void test_bilinear_operations() -
test_variants_and_flipping
public void test_variants_and_flipping() -
test_polar
public void test_polar() -
vl_hog
public float[][][] vl_hog(float[][][] image, int cellSize, boolean bilinearOrientations, HistogramOfOrientedGradients.VlHogVariant variant, int numOrientations, boolean directedPolarField, boolean undirectedPolarField) -
vl_hog
public float[][][] vl_hog(float[][] image, int cellSize, boolean bilinearOrientations, HistogramOfOrientedGradients.VlHogVariant variant, int numOrientations) -
vl_hog_permutation
public int[] vl_hog_permutation(HistogramOfOrientedGradients.VlHogVariant variant, int numOrientations) -
vl_hog_render
public float[][] vl_hog_render(float[][][] descriptor, HistogramOfOrientedGradients.VlHogVariant variant, int numOrientations) -
vl_demo_hog
public void vl_demo_hog() -
runAlgorithm
public void runAlgorithm()Description copied from class:AlgorithmBaseActually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithmin classAlgorithmBase
-