Skip to content
Advertisement

Create an image using the pixels median fom other images

I have six images and I want to find the median of each pixel and create a new pic from it. I created a list of my images in this manner:

JavaScript

and then I wrote a for loop like that:

JavaScript

I’ve found that there’s a function that finds the median using numpy but I don’t know how to use it. Also, after finding the median how can I create a picture of all the medians in the correct position of the screen? How to convert the image into an array?

Advertisement

Answer

You can use opencv to read images

JavaScript

Edit:

  • np_images is an array to store images read by opencv
  • p_value is an array to store color value of pixel at (row,col)
  • np.zeros is a function that produces zero matrix(matrix whose all values are zeros) of given shape.

To speed up the program.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement