I am using this code to load/show/write images (opencv_python-3.3.0-cp36-cp36m-win32):
import cv2
img0 = cv2.imread('original.jpg',1)
img1=img0
for i in range(img0.shape[0]):
for j in range(img0.shape[1]):
img1[i,j]=[0,0,255]
cv2.imshow('original',img0)
cv2.waitKey(0)
cv2.destroyAllWindows()
Note that line 7 is supposed to show the original image img0, but it shows the modified image img1 instead (i.e. a red rectangle). Line 3 is supposed to create a temporary copy of img0, not to modify img0. What is wrong here?