ccv

A Modern Computer Vision Library

View the Project on GitHub liuliu/ccv

lib/ccv_util.c

ccv_get_dense_matrix

ccv_dense_matrix_t* ccv_get_dense_matrix(ccv_matrix_t *mat)

Check and get dense matrix from general matrix structure.

ccv_get_sparse_matrix

ccv_sparse_matrix_t* ccv_get_sparse_matrix(ccv_matrix_t *mat)

Check and get sparse matrix from general matrix structure.

ccv_get_sparse_matrix_vector

ccv_dense_vector_t* ccv_get_sparse_matrix_vector(ccv_sparse_matrix_t *mat, int index)

Get vector for a sparse matrix.

ccv_get_sparse_matrix_cell

ccv_matrix_cell_t ccv_get_sparse_matrix_cell(ccv_sparse_matrix_t *mat, int row, int col)

Get cell from a sparse matrix.

ccv_set_sparse_matrix_cell

void ccv_set_sparse_matrix_cell(ccv_sparse_matrix_t *mat, int row, int col, void *data)

Set cell for a sparse matrix.

ccv_compress_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.

ccv_decompress_sparse_matrix

void ccv_decompress_sparse_matrix(ccv_compressed_sparse_matrix_t *csm, ccv_sparse_matrix_t **smt)

Transform a compressed matrix into a sparse matrix.

ccv_move

void ccv_move(ccv_matrix_t *a, ccv_matrix_t **b, int btype, int y, int x)

Offset input matrix by x, y.

ccv_matrix_eq

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.

ccv_slice

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.

ccv_border

void ccv_border(ccv_matrix_t *a, ccv_matrix_t **b, int type, ccv_margin_t margin)

Add border to the input matrix.

ccv_visualize

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.

ccv_flatten

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.

ccv_zero

void ccv_zero(ccv_matrix_t *mat)

Zero out a given matrix.

ccv_shift

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.

ccv_any_nan

int ccv_any_nan(ccv_matrix_t *a)

Check if any nan value in the given matrix, and return its position.

ccv_reshape

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

ccv_array_new(int rsize, int rnum, uint64_t sig)

Create a new, self-growing array.

ccv_array_push

void ccv_array_push(ccv_array_t *array, const void *r)

Push a new element into the array.

ccv_array_group

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.

ccv_array_zero

void ccv_array_zero(ccv_array_t *array)

Zero out the array, it won’t change the array->rnum however.

ccv_array_clear

void ccv_array_clear(ccv_array_t *array)

Clear the array, it will reset the array->rnum to 0.

ccv_array_free_immediately

void ccv_array_free_immediately(ccv_array_t *array)

Free up the array immediately.

ccv_array_free

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_new

ccv_contour_t* ccv_contour_new(int set)

Create a new contour object.

ccv_contour_push

void ccv_contour_push(ccv_contour_t *contour, ccv_point_t point)

Push a point into the contour object.

ccv_contour_free

void ccv_contour_free(ccv_contour_t *contour)

Free up the contour object.

ccv_array_get

ccv_array_get(a, i)

Get a specific element from an array

‹  back 

comments powered by Disqus