 
     if (x < result.cols && y < result.rows)
     {
-        float image_sq = (float)(
+        float image_sqsum_ = (float)(
                 (image_sqsum.ptr(y + h)[x + w] - image_sqsum.ptr(y)[x + w]) -
                 (image_sqsum.ptr(y + h)[x] - image_sqsum.ptr(y)[x]));
-        result.ptr(y)[x] *= rsqrtf(image_sq * templ_sqsum);
+        result.ptr(y)[x] *= rsqrtf(image_sqsum_ * templ_sqsum);
     }
 }
 

        {
            for (int j = 0; j < w; ++j)
            {
                delta = tex2D(imageTex_32F, x + j, y + i) - 
                        tex2D(templTex_32F, j, i);
                sum += delta * delta;
            }
        }

        {
            for (int j = 0; j < w; ++j)
            {
                delta = (float)tex2D(imageTex_8U_SQDIFF, x + j, y + i) - 
                        (float)tex2D(templTex_8U_SQDIFF, j, i);
                sum += delta * delta;
            }
        }
