A Modern Computer Vision Library
ccv_dense_matrix_t* ccv_get_dense_matrix(ccv_matrix_t *mat)
Check and get dense matrix from general matrix structure.
ccv_sparse_matrix_t* ccv_get_sparse_matrix(ccv_matrix_t *mat)
Check and get sparse matrix from general matrix structure.
ccv_dense_vector_t* ccv_get_sparse_matrix_vector(ccv_sparse_matrix_t *mat, int index)
Get vector for a sparse matrix.
ccv_matrix_cell_t ccv_get_sparse_matrix_cell(ccv_sparse_matrix_t *mat, int row, int col)
Get cell from a sparse matrix.
void ccv_set_sparse_matrix_cell(ccv_sparse_matrix_t *mat, int row, int col, void *data)
Set cell for a sparse matrix.
void ccv_compress_sparse_matrix(ccv_sparse_matrix_t *mat, ccv_compressed_sparse_matrix_t **csm)
Transform a sparse matrix into compressed representation.
void ccv_decompress_sparse_matrix(ccv_compressed_sparse_matrix_t *csm, ccv_sparse_matrix_t **smt)
Transform a compressed matrix into a sparse matrix.
void ccv_move(ccv_matrix_t *a, ccv_matrix_t **b, int btype, int y, int x)
Offset input matrix by x, y.
int ccv_matrix_eq(ccv_matrix_t *a, ccv_matrix_t *b)
Compare if two matrix are equal (with type). Return 0 if it is.
void ccv_slice(ccv_matrix_t *a, ccv_matrix_t **b, int btype, int y, int x, int rows, int cols)
Slice an input matrix given x, y and row, column size.
void ccv_border(ccv_matrix_t *a, ccv_matrix_t **b, int type, ccv_margin_t margin)
Add border to the input matrix.
void ccv_visualize(ccv_matrix_t *a, ccv_matrix_t **b, int type)
Convert a input matrix into a matrix within visual range, so that one can output it into PNG file for inspection.
void ccv_flatten(ccv_matrix_t *a, ccv_matrix_t **b, int type, int flag)
If a given matrix has multiple channels, this function will compute a new matrix that each cell in the new matrix is the sum of all channels in the same cell of the given matrix.
void ccv_zero(ccv_matrix_t *mat)
Zero out a given matrix.
void ccv_shift(ccv_matrix_t *a, ccv_matrix_t **b, int type, int lr, int rr)
Compute a new matrix that each element is first left shifted and then right shifted.
int ccv_any_nan(ccv_matrix_t *a)
Check if any nan value in the given matrix, and return its position.
ccv_dense_matrix_t ccv_reshape(ccv_dense_matrix_t *a, int y, int x, int rows, int cols)
Return a temporary ccv_dense_matrix_t matrix that is pointing to a given matrix data section but with different rows and cols. Useful to use part of the given matrix do computations without paying memory copy performance penalty.
ccv_array_new(int rsize, int rnum, uint64_t sig)
Create a new, self-growing array.
void ccv_array_push(ccv_array_t *array, const void *r)
Push a new element into the array.
int ccv_array_group(ccv_array_t *array, ccv_array_t **index, ccv_array_group_f gfunc, void *data)
Group elements in the array from its similarity.
void ccv_array_zero(ccv_array_t *array)
Zero out the array, it won’t change the array->rnum however.
void ccv_array_clear(ccv_array_t *array)
Clear the array, it will reset the array->rnum to 0.
void ccv_array_free_immediately(ccv_array_t *array)
Free up the array immediately.
void ccv_array_free(ccv_array_t *array)
Free up the array. If array’s signature is non-zero, we may put it into cache so that later on, we can shortcut and return this array directly.
ccv_contour_t* ccv_contour_new(int set)
Create a new contour object.
void ccv_contour_push(ccv_contour_t *contour, ccv_point_t point)
Push a point into the contour object.
void ccv_contour_free(ccv_contour_t *contour)
Free up the contour object.
ccv_array_get(a, i)
Get a specific element from an array