Package boofcv.alg.misc
Class Histogram2D_S32
java.lang.Object
boofcv.alg.misc.Histogram2D_S32
2D histogram used to count.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
get
(int row, int col) Value at the specified coordinate in the histogramvoid
increment
(int row, int col) Increments the value at the specified coordinate by 1int
indexOf
(int row, int col) Index of the specified coordinateint
maximumColIdx
(int row) Returns the column with the largest value in the specified rowint
maximumRowIdx
(int col) Returns the row with the largest value in the specified columnvoid
Prints the histogram to stdoutvoid
reshape
(int rows, int cols) Changes the size of the histogram to match the specified shape.void
set
(int row, int col, int value) Value at the specified coordinate in the histogramint
size()
Number of elements in the histogramint
sum()
Sum of all the elements in the histogramint
sumCol
(int col) Sums up all the elements in the specified column and returns the resultint
sumRow
(int row) Sums up all the elements in the specified row and returns the resultvoid
zero()
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
-