I have written a code in python opencv. I am trying to write the processed image back to disk but the image is not getting saved and it is not showing any error(runtime and comp
As Jean suggested, the error is due to the \ being interpretted as an escape sequence. It is hence always safer to use os.path.join()
as it is more cross platform and you need not worry about the escape sequence problem. For instance, in your case, you further need not worry about the first few arguments, as that is your home directory
import os
cv2.imwrite(os.path.join(os.path.expanduser('~'),'Desktop','tropical_image_sig5.bmp'), img2)
os.path.expanduser('~')
will directly return your home directory.