Hello -
I have a sequence of 16-bit grayscale images. I need to track the pixels over X-number of frames, derive the average value for each pixel, and return that value to the pixels in the first frame of the sequence. Alternatively/additionally, I would like to be able to apply those averaged values to all images in the sequence. Anybody know how to do this? I'm assuming an optical flow of some sort would be used to derive pixel motion, but past that...
Thanks so much!
Track and Return Average Pixel Value
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Track and Return Average Pixel Value
If you want to average X number of images, you can use either
convert image1 image2 ... imageX -average result
or on more current versions of IM
convert image1 image2 ... imageX -evaluate-sequence mean result
though result can be image1 if you declare the output to be image1
see
http://www.imagemagick.org/script/comma ... e-sequence
Once you have the image that represent the average at each pixel, you can apply that to another images. However, it is not clear what you want to do with the average.
Can you explain what it is that you want to do in more detail. Also identify your platform and version of IM.
convert image1 image2 ... imageX -average result
or on more current versions of IM
convert image1 image2 ... imageX -evaluate-sequence mean result
though result can be image1 if you declare the output to be image1
see
http://www.imagemagick.org/script/comma ... e-sequence
Once you have the image that represent the average at each pixel, you can apply that to another images. However, it is not clear what you want to do with the average.
Can you explain what it is that you want to do in more detail. Also identify your platform and version of IM.
Re: Track and Return Average Pixel Value
This isn't about averaging images, it's about averaging pixels over time, which is different. This will ultimately be used to reduce filmgrain in an image. Say you have a red pixel, which is moving over a series of frames. Because of grain, the value of the red will not remain constant; it'll fluctuate darker and lighter as grain interferes with it. The idea is to track the pixel's motion over X-Number of frames, and return the value to the initial position. This would then be repeated for each frame. Alternatively, you could, I suppose, just return the averaged value to all the frames at once, but there are reasons to have the option of doing it either way. But again, tracking pixel motion is absolutely crucial. Frame Accumulation/Averaging for static images already works and is available via lots of scripts and plug-ins.
_Mike
_Mike
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Track and Return Average Pixel Value
I am not sure that IM has any kind of tracking tools to locate the given pixel in each image. Do you know the path or other things that would identify any given pixel of time in the frames?