I have a grayscale image that I am reading using the following code:
import pylab as plt
. . .
circle_image = plt.imread(image_gray) #this dimension is 120,120
print(circle_image.shape) # prints (120,120)
plt.imshow(circle_image)
plt.show()
I am resizing it to 256x256 by using following:
resized_circle_image = misc.imresize(circle_image, (256,256)) # i tried using (256,256,3) but that generates resized image of (256, 256) only
print(resized_circle_image.shape) # prints (256,256)
plt.imshow(resized_circle_image)
plt.show()
I have to concatenate this image with a colored image which is of shape (256,256,3)
. How do I convert from a none channel to 3 channel image format?
What I tried:
a = np.resize(resized_circle_image, (256, 256, 3))
But that changes the image totally by repeating same image 9 times as follows: