How to determine median pixel intensity for each pixel from x number of pictures
3 views (last 30 days)
Show older comments
I am trying to do image processing and have a baseline composed of x number of images with the same dimensions.
I would like to create a single baseline image composed of the median pixel intensity of my baseline images.
I am relatively new to matlab and believe there must be a relatively easy way to do this operation. right now I am considering using a for loop to add pixel (1,1) for each individual picture append it to a list, find the median, add it to a new matrix and move on to pixel (1,2) this is obviously ineffecient and crude.
I would like an efficient script to determine the median pixel value of my each pixel pictures and create a new image composed.
Is there a way to compare the pixel intensity of each pixel for all of the images directly, doing the entire operation in one move?
0 Comments
Accepted Answer
Jon
on 15 Oct 2020
Suppose your images are each in a mRow by nCol array and you have numImages total number of images. If you put all of the images into an mRow by nCol by numImages array, lets call it X then the baseline image would be given by
xBase = median(X,3)
2 Comments
Jon
on 26 Oct 2020
Hi, Looks good. I'm glad you were able to move ahead with this and are able to start figuring out how to do things in MATLAB. If you haven't done it already a good way to get a quick immersion in MATLAB is the MATLAB On Ramp https://www.mathworks.com/learn/tutorials/matlab-onramp.html
More Answers (0)
See Also
Categories
Find more on Image Data Workflows in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!