Back to Ccv

lib/ccv_basic.c

site/0.6/lib/ccv-basic/index.html

latest2.2 KB
Original Source

lib/ccv_basic.c

ccv_sobel

void ccv_sobel(ccv_dense_matrix_t* a, ccv_dense_matrix_t** b, int type, int dx, int dy)

Compute image with Sobel operator.

  • a : the input matrix.
  • b : the output matrix.
  • type : the type of output matrix, if 0, ccv will try to match the input matrix for appropriate type.
  • dx : the window size of Sobel operator on x-axis, specially optimized for 1, 3
  • dy : the window size of Sobel operator on y-axis, specially optimized for 1, 3

ccv_gradient

void ccv_gradient(ccv_dense_matrix_t* a, ccv_dense_matrix_t **theta, int ttype, ccv_dense_matrix_t** m, int mtype, int dx, int dy)

Compute the gradient (angle and magnitude) at each pixel.

  • a : the input matrix.
  • theta : the output matrix of angle at each pixel.
  • ttype : the type of output matrix, if 0, ccv will defaults to CCV_32F.
  • m : the output matrix of magnitude at each pixel.
  • mtype : the type of output matrix, if 0, ccv will defaults to CCV_32F.
  • dx : the window size of the underlying Sobel operator used on x-axis, specially optimized for 1, 3
  • dy : the window size of the underlying Sobel operator used on y-axis, specially optimized for 1, 3

ccv_flip

void ccv_flip(ccv_dense_matrix_t* a, ccv_dense_matrix_t** b, int btype, int type)

Flip the matrix by x-axis, y-axis or both.

  • a : the input matrix.
  • b : the output matrix (it is in-place safe).
  • btype : the type of output matrix, if 0, ccv will use the sample type as the input matrix.
  • type : CCV_FLIP_X - flip around x-axis, CCV_FLIP_Y - flip around y-axis.

ccv_blur

void ccv_blur(ccv_dense_matrix_t* a, ccv_dense_matrix_t** b, int type, double sigma)

Using Gaussian blur on a given matrix. It implements a O(n * sqrt(m)) algorithm, n is the size of input matrix, m is the size of Gaussian filtering kernel.

  • a : the input matrix.
  • b : the output matrix.
  • type : the type of output matrix, if 0, ccv will try to match the input matrix for appropriate type.
  • sigma : the sigma factor in Gaussian filtering kernel.

‹ back

comments powered by Disqus