From: acl on
On Mar 19, 2:35 am, "David J. Littleboy" <davi...(a)gol.com> wrote:
> "John Sheehy" <J...(a)no.komm> wrote:
> > Lionel <use...(a)imagenoir.com> wrote:
>
> >> Not that I know of. But all the Canons already offer this amazing
> >> 'binning' feature anyway - that's what you get when you set your
> >> camera to JPEG mode, & use a JPEG size smaller than full resolution.
> >> ;^)
>
> > Well, downsampling and binning are a bit different. A downsampling should
> > use a filter to remove frequencies that complicate and artifact the
> > output.
> > Binning is just a box effect, with the contents literally added together.
>
> Binning will result in gross aliasing effects, which are very nasty with a
> Bayer sensor. So it's probably not useful in real life.
>
> Noise reduction (via a Gaussian blur) followed by downsampling wouldn't have
> that problem.
>

If I take 4x4 blocks and replace all 4 spins by the average of the
original 4 spins (but do not coarse grain them into 1 pixel, but
instead leave them as 4 separate but identical pixels), is this a
blurring operation or not? If I next take these 4 (now identical)
pixels and create one with the same value, is the combined operation
what is meant by binning or not?

Compare the above to "nearest neighbour" interpolation, which is to
take one of the 4 pixels and discard the others (thus no blurring
before downsampling, if you prefer this way of looking at it)

From: acl on
On Mar 19, 3:44 am, some idiot wrote:

> If I take 4x4 blocks and replace all 4 spins by the average of the

pixels damnit, pixels! sorry


From: David J. Littleboy on

"acl" <achilleaslazarides(a)yahoo.co.uk> wrote:
> "David J. Littleboy" <davi...(a)gol.com> wrote:
>> "John Sheehy" <J...(a)no.komm> wrote:
>>
>> > Well, downsampling and binning are a bit different. A downsampling
>> > should
>> > use a filter to remove frequencies that complicate and artifact the
>> > output.
>> > Binning is just a box effect, with the contents literally added
>> > together.
>>
>> Binning will result in gross aliasing effects, which are very nasty with
>> a
>> Bayer sensor. So it's probably not useful in real life.
>>
>> Noise reduction (via a Gaussian blur) followed by downsampling wouldn't
>> have
>> that problem.
>
> If I take 4x4 blocks and replace all 4 pixels by the average of the
> original 4 pixels (but do not coarse grain them into 1 pixel, but
> instead leave them as 4 separate but identical pixels), is this a
> blurring operation or not? If I next take these 4 (now identical)
> pixels and create one with the same value, is the combined operation
> what is meant by binning or not?

Yes. Binning (presumably) averages four (or some other number) of pixels
with no information from any other pixels. This doesn't work very well as a
low-pass filter, and allows aliasing artifacts to occur.

Applying a (well-designed) blur at every pixel at the higher resolution and
then downampling will produce an image with much lower levels of aliasing
artifacts.

> Compare the above to "nearest neighbour" interpolation, which is to
> take one of the 4 pixels and discard the others (thus no blurring
> before downsampling, if you prefer this way of looking at it)

That's decimation. And is, of course, even worse than averaging, since it
approximates point sampling.

David J. Littleboy
Tokyo, Japan


From: John Sheehy on
"David J. Littleboy" <davidjl(a)gol.com> wrote in
news:etkl07$nve$1(a)nnrp.gol.com:

>
> "John Sheehy" <JPS(a)no.komm> wrote:
>> Lionel <usenet(a)imagenoir.com> wrote:
>>
>>> Not that I know of. But all the Canons already offer this amazing
>>> 'binning' feature anyway - that's what you get when you set your
>>> camera to JPEG mode, & use a JPEG size smaller than full resolution.
>>> ;^)
>>
>> Well, downsampling and binning are a bit different. A downsampling
>> should use a filter to remove frequencies that complicate and
>> artifact the output.
>> Binning is just a box effect, with the contents literally added
>> together.
>
> Binning will result in gross aliasing effects, which are very nasty
> with a Bayer sensor. So it's probably not useful in real life.

That's true with large binnings. For 2x2 ones, from cameras with AA
filters, you're actually not going to see much aliasing.

There are so many ways to bin, though. If you want to bin big, you have
the option of including overlapping pixels in multiple output pixels.

> Noise reduction (via a Gaussian blur) followed by downsampling
> wouldn't have that problem.

Downsampling often reduces the noise statistic better than binning, but the
(traditionally) binned image is already sharper to begin with.

Median filtering is better than gaussian blur, IME. (unless you just do
blur on 'a' and 'b' in Lab mode for chromatic noise). I made my own CFA-
aware median filter in Filtermeister that is based on ratio instead of
difference from neighbors. Good for hot pixels, and warm and cool ones and
dead ones, as well.

PS' "dust and scratches" can actually work well, too, before downsampling.


--

<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
John P Sheehy <JPS(a)no.komm>
><<> <>>< <>>< ><<> <>>< ><<> ><<> <>><
From: Scott W on
On Mar 18, 1:35 pm, "David J. Littleboy" <davi...(a)gol.com> wrote:
> Binning will result in gross aliasing effects, which are very nasty with a
> Bayer sensor. So it's probably not useful in real life.
>
> Noise reduction (via a Gaussian blur) followed by downsampling wouldn't have
> that problem.
>
> David J. Littleboy
> Tokyo, Japan

Whereas binning will lead to some artifacts it is not much worse then
bicubic. It is pretty simple to do a quick test in Photoshop to see
how binning will affect the image, use a custom filter with the 5x5
matrix fill in with 1s and the scale set to 25. Then down sample to
20% using nearest neighbor sampling. Make sure the original image is
size by a factor of 5 in both height and width otherwise you won't get
true binning.

This is a test I did, here is the original image.
http://www.pbase.com/konascott/image/75855908/original

This is the image that you get binning 5 x 5 pixels, so the new image
is 20% the size of the original.
http://www.pbase.com/konascott/image/75855919/original
Note there are some artifacts in the steeple of the church.

This is a down sampling using bicubic
http://www.pbase.com/konascott/image/75855954/original
The artifacts look about the same here as in the one that used
binning.

This time I have used gaussian blur followed by down sampling to 20%,
using nearest neighbor.
http://www.pbase.com/konascott/image/75856012/original
Here we are pretty much free of the artifacts.

Now if you want something really bad just down sample using nearest
neighbor with no filtering before hand.
http://www.pbase.com/konascott/image/75856104/original

No the one disclaimer is that this was not done with the raw value
from the bayer sensor but rather a filer that had already been
converter to RGB.

Scott