Using python for images


I had excercise in python which I’m new in it, for job of image processing,
my question is given 6 images and I have to pass over them and find the median of each pixel,
I wrote something but I get a wrong syntax:

import cv2

imgs=['1.jpg', '2.jpg', '3.jpg', '4.jpg', '5.jpg', '6.jpg'] 
np_images = []

for img in imgs:
# assuming the dimensions of all images are the same
median_image  = np.zeros((np_images[0].shape))
shape = np_images[0].shape
for row in range(shape[0]):
    for col in range(shape[1]):
        for c in range(shape[2]):
            p_values = []
            for image in np_images:
                   median_image[row][col][c] = np.median(p_values)

the problem is with the median_image.
can anyone help me?


never mind, I solve it!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.