loading
 
Binning pixels to increase signal
Hibou from France  [8 posts]
16 year
A module to bin pixels to increase signal at the expense of resolution would be useful. It should be possible to bin different numbers of pixels in the X and Y directions - I even have a measuring application that calls for binning all pixels in one direction to give a 1D image that might be plotted using the SurfacePlot module, which is otherwise very nice for mapping 2D intensity data.
Alan H. Grenoble
Anonymous 16 year
Alan,

Let me see if I understand what you are asking for.

Given four gray pixels (we will stick with gray to keep things easy)

255,255
255,255

the single "bin" that includes all pixels would then become 1020

likewise with

255,0
0,255

the single "bin" that includes all pixels would then become 510

Is this correct? Or are you thinking that the highest pixel would take
ownership as in

255,0
0,255

would be 255?

If you have any reference sites that have sample images of what you're referring to that would be very helpful.

Thanks,
STeven.


Hibou from France  [8 posts] 16 year
STeven, binning would mean simply summing the intensities and reducing the number of pixels. Of course when you represent this on a grayscale you would have to rescale the numbers. This is typically done with CCD cameras operating in low-light conditions, sacrificing resolution for signal.

BTW, 8-bit grayscale is hardly enough for technical applications. Displaying as 8-bit might be OK, but it would be nice to save at 12 or even 16-bit (see http://en.wikipedia.org/wiki/Grayscale )
Anonymous 16 year
Alan,

So essentially this appears to be a scaling operation where each four pixels are added and then divided by 4 (or reduced by 2 bits) to yield the resulting pixel value in the 0-255 range. Because we have to normalize the intensity after addition to "fit" into the 8 bit limit the binning is just a form of scaling ... which I don't think is going to give you what you need. This will tend to keep strong wide signals strong but weaken other thinner signals that are strong in height but only display in a single pixel wide.

Perhaps we could try another way ... what is the desired effect that you are looking for? Would you happen to have an example image of before and after the desired process?

STeven.
Hibou from France  [8 posts] 16 year
OK, I'll think more about this STeven. But I am assuming that in a low-light image there will be a certain statistical scatter of neighbouring pixel intensities, and that one might improve those statistics by binning. So a group of pixels with nominal value 100 would be normally distributed between 90 and 110 (100+- sqrt100). Summing 4 of them to a nominal value of 400 they would be normally distributed between 380 and 420 (400+- sqrt400 ) or after dividing by 4, between 95 and 105. A group of pixels of value 0 would remain 0.

I will try to make an example to illustrate the interest of doing that. In an extreme case, complete binning along one direction would give a better 1D image than any one line through the original 2D image. Why might I be interested in 1D images ? Well, if I wanted to measure the intensity profile of something that only varies in 1D but that can be recorded in 2D - the brightness of the moonlit sky as a function of distance from the horizon as a trivial example.

Alan.
hibou from France  [30 posts] 16 year
I took a while to find an example that other people could try, and finally it did not seem as useful as I had expected, though it would still be needed for integrating 2D data along one axis. Various image treatment programs have such a "binning option". For example, ImageJ calls it an "Averaging_Reducer" http://rsb.info.nih.gov/ij/plugins/reducer.html
Anonymous 16 year
Alan,

We had a quick look at code for the ImageJ plugin and it just seems to be the correct way to scale down an image. The wrong way to scale down is just to grab every other pixel ... when in fact you should just average the 4 (2x2) pixels to get the new one. Strange that the default scale in ImageJ does not already do this. RoboRealm does do the averaging using the Scale module ... so I guess we already have that?

STeven.
hibou from France  [30 posts] 16 year
Thanks for confirming that STeven. Square binning is indeed generally sufficient for binning to improve images with faint features. For the 1D-binning (projection) that I referred to in my original post, I found that ImageJ can do that with the "Binner" plugin http://valelab.ucsf.edu/~nico/IJplugins/Binner.html
hibou from France  [30 posts] 16 year
...And of course you can also do 1D-binning using the scale model in RoboRealm. Sorry, I didn't look at your Scale module carefully before submitting my post. You are saying that with the default "bilinear resize" option it is indeed doing the kind of averaging that I want. I will check this out with a real example.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index