0

This is a simple program to create an empty image and save it with name con.jpg.

import cv2
import numpy

img = numpy.zeros([500,500],numpy.uint8)
cv2.imwrite("con.jpg",img)

But the image is not getting saved with this name con.jpg whereas if I write the name anything else like a , con1, cont, etc its working fine. Any answer for this weird behavior of imwrite.

Joseph D.
  • 11,073
  • 3
  • 27
  • 60
  • What platform? Which version of OpenCV (not that it would make much difference given the cause)? – Dan Mašek May 16 '17 at 18:42
  • 4
    Possible duplicate of [Why does naming a file 'con.txt' in windows make Python write to console, not file?](http://stackoverflow.com/questions/9895686/why-does-naming-a-file-con-txt-in-windows-make-python-write-to-console-not-fi) -- i.e. You're trying to use a reserved word as a file name. That won't work. – Dan Mašek May 16 '17 at 18:43

0 Answers0