Back to Ccv

lib/ccv_resample.c

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

latest1.9 KB
Original Source

lib/ccv_resample.c

ccv_resample

void ccv_resample(ccv_dense_matrix_t* a, ccv_dense_matrix_t** b, int btype, int rows, int cols, int type)

Resample a given matrix to different size, as for now, ccv only supports either downsampling (with CCV_INTER_AREA) or upsampling (with CCV_INTER_CUBIC).

  • a : the input matrix.
  • b : the output matrix.
  • btype : the type of output matrix, if 0, ccv will try to match the input matrix for appropriate type.
  • rows : the new row.
  • cols : the new column.
  • type : for now, ccv supports CCV_INTER_AREA, which is an extension to bilinear resampling for downsampling and CCV_INTER_CUBIC bicubic resampling for upsampling.

ccv_sample_down

void ccv_sample_down(ccv_dense_matrix_t* a, ccv_dense_matrix_t** b, int type, int src_x, int src_y)

Downsample a given matrix to exactly half size with a Gaussian filter. The half size is approximated by floor(rows * 0.5) x floor(cols * 0.5).

  • 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.
  • src_x : shift the start point by src_x.
  • src_y : shift the start point by src_y.

ccv_sample_up

void ccv_sample_up(ccv_dense_matrix_t* a, ccv_dense_matrix_t** b, int type, int src_x, int src_y)

Upsample a given matrix to exactly double size with a Gaussian filter.

  • 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.
  • src_x : shift the start point by src_x.
  • src_y : shift the start point by src_y.

‹ back

comments powered by Disqus