<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; 3.4.2</li>
<li>Operating System / Platform =&gt; <g-emoji class="g-emoji" alias="grey_question" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2754.png">❔</g-emoji></li>
<li>Compiler =&gt; Windows 10 64 Bit</li>
</ul>
<h5 dir="auto">Detailed description</h5>

<p dir="auto">The mask parameter of matchTemplate doesn't work on TM_CCOEFF and TM_CCOEFF_NORMED. Is there any workaround except using other template matching methods? I prefer using CCOEFF_NORMED since it's much faster.</p>
<h5 dir="auto">Steps to reproduce</h5>
<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt;  4.5.5.64</li>
<li>Operating System / Platform =&gt; Ubuntu Linux</li>
<li>Compiler =&gt; gcc?</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">The Swiss QR-bills are detected but not decoded.</p>
<p dir="auto">See also: <a href="https://scanbot.io/en/sdk/scanner-sdk/barcode-scanner-sdk/swiss-qr" rel="nofollow">https://scanbot.io/en/sdk/scanner-sdk/barcode-scanner-sdk/swiss-qr</a></p>
<h5 dir="auto">Steps to reproduce</h5>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import cv2

image = cv2.imread(&quot;test-qr-code/155567196-54dbec58-7fa4-473a-a551-b52ecd04e11e.png&quot;)
detector = cv2.QRCodeDetector()
print(detector.detect(image))

data, bbox, straight_qrcode = detector.detectAndDecode(image)
print(data)
print(bbox)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">cv2</span>

<span class="pl-s1">image</span> <span class="pl-c1">=</span> <span class="pl-s1">cv2</span>.<span class="pl-en">imread</span>(<span class="pl-s">"test-qr-code/155567196-54dbec58-7fa4-473a-a551-b52ecd04e11e.png"</span>)
<span class="pl-s1">detector</span> <span class="pl-c1">=</span> <span class="pl-s1">cv2</span>.<span class="pl-v">QRCodeDetector</span>()
<span class="pl-en">print</span>(<span class="pl-s1">detector</span>.<span class="pl-en">detect</span>(<span class="pl-s1">image</span>))

<span class="pl-s1">data</span>, <span class="pl-s1">bbox</span>, <span class="pl-s1">straight_qrcode</span> <span class="pl-c1">=</span> <span class="pl-s1">detector</span>.<span class="pl-en">detectAndDecode</span>(<span class="pl-s1">image</span>)
<span class="pl-en">print</span>(<span class="pl-s1">data</span>)
<span class="pl-en">print</span>(<span class="pl-s1">bbox</span>)</pre></div>
<p dir="auto">With image: <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/353872/165976543-3c9b0ae8-5958-4756-b8c6-25485834da87.png"><img width="238" alt="155567196-54dbec58-7fa4-473a-a551-b52ecd04e11e" src="https://user-images.githubusercontent.com/353872/165976543-3c9b0ae8-5958-4756-b8c6-25485834da87.png" style="max-width: 100%;"></a><br>
=&gt;</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(True, array([[[ 42.,  42.],
        [433.,  42.],
        [433., 433.],
        [ 42., 433.]]], dtype=float32))

[[[ 42.  42.]
  [433.  42.]
  [433. 433.]
  [ 42. 433.]]]"><pre class="notranslate"><code class="notranslate">(True, array([[[ 42.,  42.],
        [433.,  42.],
        [433., 433.],
        [ 42., 433.]]], dtype=float32))

[[[ 42.  42.]
  [433.  42.]
  [433. 433.]
  [ 42. 433.]]]
</code></pre></div>
<h5 dir="auto">Issue submission checklist</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I report the issue, it's not a question

</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I checked the problem with documentation, FAQ, open issues,<br>
forum.opencv.org, Stack Overflow, etc and have not found any solution

</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I updated to the latest OpenCV version and the issue is still there

</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> There is reproducer code and related data files: videos, images, onnx, etc

</li>
</ul>