擅长:python、mysql、java
<p><a href="http://docs.opencv.org/2.4/modules/highgui/doc/reading_and_writing_images_and_video.html#bool%20imwrite(const%20string&%20filename,%20InputArray%20img,%20const%20vector%3Cint%3E&%20params)" rel="nofollow noreferrer">imwrite</a>方法需要扩展名来确定文件格式。在</p>
<p>只需将行更改为(对于PNG,或任何您想要的文件格式),它应该可以工作:</p>
<pre><code>imageName = "image"+counter+".png"
</code></pre>
<p>如果需要,可以稍后使用<code>glob.glob</code>重命名这些文件。一个有效的例子应该是这样的:</p>
^{pr2}$