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: np_images.append(cv2.imread(img,1)) # assuming the dimensions of all images are the same median_image = np.zeros((np_images.shape)) shape = np_images.shape for row in range(shape): for col in range(shape): for c in range(shape): p_values =  for image in np_images: p_values.append(image[row][col][c] median_image[row][col][c] = np.median(p_values)
the problem is with the median_image.
can anyone help me?