Package boofcv.alg.misc
Class Histogram2D_S32
java.lang.Object
boofcv.alg.misc.Histogram2D_S32
2D histogram used to count.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintget(int row, int col) Value at the specified coordinate in the histogramvoidincrement(int row, int col) Increments the value at the specified coordinate by 1intindexOf(int row, int col) Index of the specified coordinateintmaximumColIdx(int row) Returns the column with the largest value in the specified rowintmaximumRowIdx(int col) Returns the row with the largest value in the specified columnvoidPrints the histogram to stdoutvoidreshape(int rows, int cols) Changes the size of the histogram to match the specified shape.voidset(int row, int col, int value) Value at the specified coordinate in the histogramintsize()Number of elements in the histogramintsum()Sum of all the elements in the histogramintsumCol(int col) Sums up all the elements in the specified column and returns the resultintsumRow(int row) Sums up all the elements in the specified row and returns the resultvoidzero()Fills all elements in data that are in use to zero.
-
Field Details
-
data
public int[] dataValue of each cell in the histogram -
rows
public int rowsHistogram's shape -
cols
public int colsHistogram's shape
-
-
Constructor Details
-
Histogram2D_S32
public Histogram2D_S32()
-
-
Method Details
-
reshape
public void reshape(int rows, int cols) Changes the size of the histogram to match the specified shape. Size of data is changed only when it's too small for the new shape. -
zero
public void zero()Fills all elements in data that are in use to zero. -
increment
public void increment(int row, int col) Increments the value at the specified coordinate by 1 -
sumRow
public int sumRow(int row) Sums up all the elements in the specified row and returns the result -
sumCol
public int sumCol(int col) Sums up all the elements in the specified column and returns the result -
maximumColIdx
public int maximumColIdx(int row) Returns the column with the largest value in the specified row -
maximumRowIdx
public int maximumRowIdx(int col) Returns the row with the largest value in the specified column -
sum
public int sum()Sum of all the elements in the histogram -
get
public int get(int row, int col) Value at the specified coordinate in the histogram -
set
public void set(int row, int col, int value) Value at the specified coordinate in the histogram -
indexOf
public int indexOf(int row, int col) Index of the specified coordinate -
size
public int size()Number of elements in the histogram -
print
Prints the histogram to stdout- Parameters:
format- Printf format for the value
-