#267·ccv

TLD bug in unstable

Author: abagnall-riversideCreated Apr 11, 2025Updated Apr 11, 2025

Hi,

I was trying to use the predator implementation in ccv_tld.c (unstable), and encountered the following assertion failure:

ccv_tld.c:485: float _ccv_tld_sv_classify(ccv_tld_t *, ccv_dense_matrix_t *, int, int, int *, int *): Assertion `a->rows == tld->patch.height && a->cols == tld->patch.width' failed.

I think the problem is in this call to ccv_resample. It looks like the rows and cols parameters of ccv_resample have been changed at some point to rows_scale and cols_scale, but the corresponding change hasn't been applied at this call site.

I fixed it locally (or so I think) by changing

c
ccv_resample(c, b, type, tld->patch.height, tld->patch.width, CCV_INTER_AREA | CCV_INTER_CUBIC);

to

c
ccv_resample(c, b, type, tld->patch.height / (double)c->rows, tld->patch.width / (double)c->cols, CCV_INTER_AREA | CCV_INTER_CUBIC);