<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt; 3.1</li>
<li>Operating System / Platform =&gt; Windows 64 Bit</li>
<li>Compiler =&gt; Visual Studio 2015</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto"><code class="notranslate">waitKey()</code> returns <code class="notranslate">255</code> instead of <code class="notranslate">-1</code>.</p>
<h5 dir="auto">Steps to reproduce</h5>
<div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#include &lt;iostream&gt;
#include &lt;opencv/cv.hpp&gt;

int main(int argc, char** argv)
{
	cv::Mat test(480, 640, CV_8UC1);
	test.setTo(0);
	cv::imshow(&quot;test&quot;, test);
	std::cout &lt;&lt; cv::waitKey(1) &lt;&lt; std::endl;
	return 0;
}"><pre class="notranslate">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">&lt;</span>iostream<span class="pl-pds">&gt;</span></span>
#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">&lt;</span>opencv/cv.hpp<span class="pl-pds">&gt;</span></span>

<span class="pl-k">int</span> <span class="pl-en">main</span>(<span class="pl-k">int</span> argc, <span class="pl-k">char</span>** argv)
{
	cv::Mat <span class="pl-smi">test</span>(<span class="pl-c1">480</span>, <span class="pl-c1">640</span>, CV_8UC1);
	test.<span class="pl-c1">setTo</span>(<span class="pl-c1">0</span>);
	<span class="pl-c1">cv::imshow</span>(<span class="pl-s"><span class="pl-pds">"</span>test<span class="pl-pds">"</span></span>, test);
	std::cout &lt;&lt; <span class="pl-c1">cv::waitKey</span>(<span class="pl-c1">1</span>) &lt;&lt; std::endl;
	<span class="pl-k">return</span> <span class="pl-c1">0</span>;
}</pre></div>
<h5 dir="auto">Expected output</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="-1"><pre class="notranslate"><code class="notranslate">-1
</code></pre></div>
<h5 dir="auto">Actual output</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="255"><pre class="notranslate"><code class="notranslate">255
</code></pre></div>
<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&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>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; <g-emoji class="g-emoji" alias="grey_question" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2754.png">❔</g-emoji></li>
</ul>
<h5 dir="auto">Detailed description</h5>

<h5 dir="auto">Steps to reproduce</h5>

<p dir="auto">my cuda is NVIDIA 10.1, cudnn is 9.0, when i compile it:</p>
<details>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/40679769/69939471-e7c4f880-151a-11ea-8c3d-a1a9b01b9b43.png"><img src="https://user-images.githubusercontent.com/40679769/69939471-e7c4f880-151a-11ea-8c3d-a1a9b01b9b43.png" alt="图片" style="max-width: 100%;"></a></p>
</details>