When I am trying to save an image, the saved image is black. This is the code for saving the image:-
sm = pySaliencyMap.pySaliencyMap(frame_width, frame_height)
saliency_map = sm.SMGetSM(frame)
cv2.imshow('Saliency Map', saliency_map)
filename_saliency = 'saliency_map' + str(saliency_num) + '.png'
cv2.imwrite(filename_saliency, saliency_map)
saliency_num += 1
The cv2.imshow displays the image correctly. But, cv2.imwrite operation returns a black image. Any help why is this issue occuring and how to resolve it? Appreciate it!