First, my 3 separate scenarios and my input image
Scenario 1: Copying input image onto new variable by " = "
a = cv2.imread("/content/consec2.jpg") b = a b [b < 200] = 0 #Some random change to an image plt.imshow(a, cmap='gray')
Image Displayed: ("changed" image)
Scenario 2: Copying input image onto new variable by .copy() method
a = cv2.imread("/content/consec2.jpg") b = a.copy() b [b < 100] = 0 #Same random change to the image as in scenario 1 plt.imshow(a, cmap='gray')
Image Displayed: The original input image
Scenario 3: Normal calculation (Disregard the image here)
a = 10
b = a
print (a)
Result: the printed value comes out to 10 (This scenario is just for extra refernce).
QUESTION: Why are scenario 1 and scenario 2 giving differnet results? Shouldn't the " = " and .copy() function the same way in this case?