public class HOGOperation extends java.lang.Object implements DatasetOperation
Constructor and Description |
---|
HOGOperation()
Construct a HOG operation with a cell radius of 4, 4 cells per block, and 9 histogram bins.
|
HOGOperation(int cellRadius,
int blockSize,
int nbins)
Construct a HOG operation.
|
Modifier and Type | Method and Description |
---|---|
Dataset |
descriptors(Dataset input)
Computes the normalized HOG descriptors for the specified input
|
int |
getBlockSize()
Number of cells in a block in one dimension i.e.
|
int |
getCellRadius()
Number of data points in a cell's radius.
|
int |
getCellWidth()
Total width of a square cell
|
double |
getMAXANGLE()
Maximum angle in the histogram in radians.
|
double |
getMINANGLE()
Minimum angle in the histogram in radians.
|
int |
getNbins()
Number of bins in the local histgram
|
java.util.Map<java.lang.String,java.lang.Object> |
getObjectMap()
Creates a map of the important fields for the instance, suitable for serialization.
|
long |
getSerializationVersion()
Returns the current version of the serialization format.
|
int |
getVersion()
Returns the current class version.
|
GradientVector |
gradientVector(Dataset input)
Calculates the gradient vector of the input
|
void |
initCurrentVersion(java.util.Map<java.lang.String,java.lang.Object> objectMap)
Initializes an instance with a current-version object graph.
|
static void |
main(java.lang.String[] args) |
double[] |
normalize(double[] data)
Normalizes an array by dividing each element by the magnitude of the vector.
|
Dataset |
run(Dataset input)
Runs the operation on an input.
|
void |
setBlockSize(int blockSize) |
void |
setCellRadius(int cellRadius) |
void |
setCellWidth(int cellWidth) |
void |
setMAXANGLE(double MAXANGLE)
Sets the maximum angle in the histogram in radians.
|
void |
setMINANGLE(double MINANGLE)
Sets the minimum angle in the histogram in radians.
|
void |
setNbins(int nbins)
Sets the number of bins to use in the histogram
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
init, initPreviousVersion, initUnknownVersion, load, read, save, write
public HOGOperation()
public HOGOperation(int cellRadius, int blockSize, int nbins)
cellRadius
- radius of a cell (number of points in one cell = (2*r + 1)^2)blockSize
- radius of a block (number of cells in one block = bs * bs)nbins
- number of histogram binspublic Dataset run(Dataset input)
DatasetOperation
run
in interface DatasetOperation
input
- Dataset on which to operatepublic GradientVector gradientVector(Dataset input)
input
- input Datasetpublic Dataset descriptors(Dataset input)
input
- data to inspectpublic double[] normalize(double[] data)
data
- data to normalizepublic int getCellRadius()
public void setCellRadius(int cellRadius)
public int getCellWidth()
public void setCellWidth(int cellWidth)
public int getBlockSize()
public void setBlockSize(int blockSize)
public int getNbins()
public void setNbins(int nbins)
nbins
- number of binspublic double getMAXANGLE()
public void setMAXANGLE(double MAXANGLE)
MAXANGLE
- maximum angle in radianspublic double getMINANGLE()
public void setMINANGLE(double MINANGLE)
MINANGLE
- minimum angle in radianspublic long getSerializationVersion()
ObjectMap
getSerializationVersion
in interface ObjectMap
public int getVersion()
ObjectMap
getVersion
in interface ObjectMap
public java.util.Map<java.lang.String,java.lang.Object> getObjectMap()
ObjectMap
getObjectMap
in interface ObjectMap
public void initCurrentVersion(java.util.Map<java.lang.String,java.lang.Object> objectMap)
ObjectMap
initCurrentVersion
in interface ObjectMap
objectMap
- object graph for initializationpublic static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception