int code = CvArrTest::write_default_params( fs );
if( code < 0 )
return code;
-
+
if( ts->get_testing_mode() == CvTS::CORRECTNESS_CHECK_MODE )
{
write_param( fs, "max_template_size", max_template_size );
else
{
int i;
- start_write_param( fs );
-
+ start_write_param( fs );
+
cvStartWriteStruct( fs, "template_size", CV_NODE_SEQ+CV_NODE_FLOW );
for( i = 0; templmatch_template_sizes[i].width >= 0; i++ )
{
double CV_TemplMatchTest::get_success_error_level( int /*test_case_idx*/, int /*i*/, int /*j*/ )
{
if( CV_MAT_DEPTH(test_mat[INPUT][1].type) == CV_8U ||
- method >= CV_TM_CCOEFF && test_mat[INPUT][1].cols*test_mat[INPUT][1].rows <= 2 )
+ (method >= CV_TM_CCOEFF && test_mat[INPUT][1].cols*test_mat[INPUT][1].rows <= 2) )
return 1e-2;
else
return 1e-3;
cvSet( result, cvScalarAll(1.) );
return;
}
-
+
if( method & 1 )
{
b_denom = 0;
CvScalar a_sum = {{ 0, 0, 0, 0 }}, a_sum2 = {{ 0, 0, 0, 0 }};
CvScalar ccorr = {{ 0, 0, 0, 0 }};
double value = 0.;
-
+
if( depth == CV_8U )
{
const uchar* a = img->data.ptr + i*img->step + j*cn;
const uchar* b = templ->data.ptr;
-
+
if( cn == 1 || method < CV_TM_CCOEFF )
{
for( k = 0; k < height; k++, a += a_step, b += b_step )
{
const float* a = (const float*)(img->data.ptr + i*img->step) + j*cn;
const float* b = (const float*)templ->data.ptr;
-
+
if( cn == 1 || method < CV_TM_CCOEFF )
{
for( k = 0; k < height; k++, a += a_step, b += b_step )
if( method & 1 )
{
double denom;
-
+
// calc denominator
if( method != CV_TM_CCOEFF_NORMED )
{
else
value = method != CV_TM_SQDIFF_NORMED || value < DBL_EPSILON ? 0 : 1;
}
-
+
((float*)(result->data.ptr + result->step*i))[j] = (float)value;
}
}