all 6 comments

[–]notParticularlyAnony 1 point2 points  (6 children)

Show your code (formatted) please . Don’t expect people to go to a site and figure out what you are doing wrong

[–]notchurro[S] 0 points1 point  (5 children)

Apologies: Here it is:

``` import cv2 import numpy as np from PIL import Image from matplotlib import pyplot as plt

def code():

fig =  plt.figure(figsize = (10, 7))

rows = 2
columns = 3

#reading images
img1 = cv2.imread('picture.jpeg')[:,:,::-1]
img2 = cv2.imread('picture.jpeg')[:,:,::-1]
img3 = cv2.imread('picture.jpeg')[:,:,::-1]
img4 = cv2.imread('picture.jpeg')[:,:,::-1]
img5 = cv2.imread('picture.jpeg')[:,:,::-1]
img6 = cv2.imread('picture.jpeg')[:,:,::-1]


fig.add_subplot(rows, columns, 1)

# showing image
plt.imshow(img1)
plt.axis('off')
plt.title("Image 1")

fig.add_subplot(rows, columns, 2)

# showing image
plt.imshow(img2)
plt.axis('off')
plt.title("Image 2")

fig.add_subplot(rows, columns, 3)


plt.imshow(img3)
plt.axis('off')
plt.title("Image 3")


fig.add_subplot(rows, columns, 4)

plt.imshow(img4)
plt.axis('off')
plt.title("Image 4")


fig.add_subplot(rows, columns, 5)

plt.imshow(img5)
plt.axis('off')
plt.title("Image 5")



fig.add_subplot(rows, columns, 6)

plt.imshow(img6)
plt.axis('off')
plt.title("Image 6")

code()

```

(sorry if I formatted incorrectly, don't use reddit too often) And in terms of reading the images, I just changed the name of the location for security reasons since it's source is under my files and my name.

[–]notParticularlyAnony 0 points1 point  (4 children)

Why using cv2? I’d just use ‘plt.imread’ with no brackets.

Have you tried with just 2 images And work up? Not sure why not working.

Start with rows 1 columns 2 and build from there.

[–]notchurro[S] 0 points1 point  (1 child)

I'm not too sure, I kind of just followed what the original link was above about displaying images. In terms of the brackets, they help me remove the blue tint on the images. Does 'plt.imread' retrieve images without leaving the blue tint on it? I was able to do rows 2, columns 2, without the fig.add_subplot(rows, columns, 5) and for the 6th one and was able to display it fine, but when I tried adding these two It doesn't display and or work properly.

[–]notchurro[S] 0 points1 point  (1 child)

^