I'm working on MODIS NDVI composite data (single band). I converted the image to a numpy array and performed filtering operations. When i'm saving the new numpy array as an image I get a 3 band image instead of single band image. How can I save it as a single band image?
#read an image
img = cv2.imread("D:/trial/MOD09_NDVI.A2017001.tif")
cv2.namedWindow('Unfiltered Image', cv2.WINDOW_NORMAL)
cv2.imshow('Unfiltered Image',img)
cv2.waitKey(0)
#apply filter
myIMG = cv2.blur(img, (5,5))
cv2.namedWindow('Blur Image', cv2.WINDOW_NORMAL)
cv2.imshow('Blur Image', myIMG)
cv2.waitKey(0)
scipy.misc.imsave('D:/trial/blur_55.tif', myIMG)
------------
scipy.misc.imsave('D:/trial/blur_55.tif', myIMG)
saves a 3 band image instead of original single band image