image array value changes after execution in python -
i new python , working on image processing based project. working on spyder on windows , using ipython console. image when converted array becomes array ranging 0-255 values. doing:
image = cv2.imread("imagetest.png") im = image.astype('float') im[5,5,0] = 3000 # changing pixel value cv2.imwrite("save.png", im) # open image again check if pixel still same or not image = cv2.imread("save.png") im = image.astype('float') if im[5,5,0] == 3000: print "yes" else: print "no"
the problem is, whenever open image check, pixel value changed , goes default value ( whatever have been before modification ). why happening? there way in can save manipulated pixel image , retrieve while checking?
Comments
Post a Comment