-4

The code is not giving the output picture

import numpy as np
import cv2 as cv

img = cv.imread('Picture1.jpg',0)
cv.imshow('image',img)
cv.waitKey(0)
cv.imwrite('Picture1.jpg',img)
cv.destroyAllWindows()
Red
  • 26,798
  • 7
  • 36
  • 58

1 Answers1

0

Make sure that the Picture1.jpg file is in the same directory as the python file you are running.

Or try calling startWindowThread():

import numpy as np
import cv2 as cv

img = cv.imread('Picture1.jpg',0)
cv.startWindowThread()
cv.imshow('image',img)
cv.waitKey(0)
cv.imwrite('Picture1.jpg',img)
cv.destroyAllWindows()
Red
  • 26,798
  • 7
  • 36
  • 58