Log in

View Full Version : Quickie (true/false question) about Bilinear Resizing


Gew
7th August 2009, 14:35
Does BilinearResize() introduce pixel blurring to a certain degree even when using it to downsize a clip?

Additionally (of less importance), does this have something to do with the phenomenon "anti-aliasing" that I've heard about.

I tried Googling my main question but didn't find any concrete answers.

Ty in advance.

Guest
7th August 2009, 14:48
Does BilinearResize() introduce pixel blurring to a certain degree even when using it to downsize a clip? The output pixels combine information from multiple input pixels, so in that the sense there is blurring. But your question is imprecise because "pixel blurring" is meaningless.

Gew
7th August 2009, 16:09
I see. Of course, a bit inprecise, I agree. I'll try to be more specific. My goal was to achieve (roughly) the same level of temporal smoothing on the same video clip, but with two different output scales on pixel dimension. Or really quite the same question at issue but in other terms: iif putting temporal smoother before/after resize mattered much since it's a 3D operation.

So. I ran a heavy-duty post on another bulletin board and received all the help I needed. The conclusion of the expert who answered me was that to get the exact same amount of smoothing was a hardnut, cuz' sharpening resize algorithms ie. Bicubic/Lanczos would boost contrast so that eg. AviSource("640x480.avi").BicubicResize(320,240).TemporalSoften(2,3,3,10,2) presumably would cause some minor parts of the spots detected (and averaged) in just AviSource("640x480.avi").TemporalSoften(2,3,3,10,2) be bumped above threshhold, thus be ignored.

It all made perfectly sense.

THEN I suddenly had this brilliant idea. I started thinking about the Bilinear resizing algorithm, which had been (prolly much simplified) explained as "non-sharpening", and I figured that using this one instead of Bicubic for the downsize would make the resemblance in smoothing amount more precise. I just _had_ to post my idea. Then the expert quickly replied:

"I think there will still be a little difference because BilinearResize() will cause some of the noise just above the temporal filter's threshold to fall below the threshold."


Meaning that this method would hit "the other way around". I replied my satisfaction over the answers and tagged the thread as a case closed. However, then I started to brood/deep-analyze what he had written. I tried to wrap it up in a summary:

Bicubic=Sharpening ; increasing the spatial contrast = need for a higher threshold setting.
Bilinear=Must be the opposite??? Blurring?? ; decreasing the spatial contrast??? = need for a lower threshold setting.

I agreed to myself. But then when I was sitting in the sofa, it suddenly felt unlikely that an actual _shrink_ could cause blurring, and I felt the need for that final verification. Could have re-bumped my thread on that board where I had dragged the whole subject, but with the risk of inflaming the guy who had already answered way too many bumps and follow-ups on my novice questions, I decided to take it to another board, so it ended here :)

Hope you have my question somewhat covered now.


Summary:
Will bilinear downsizing cause blurring?

Guest
7th August 2009, 16:38
Will bilinear downsizing cause blurring? If you are worried about the effect on thresholds for subsequent filters, you can look at a histogram of pixel values before and after to see what the resize operation has done.

You could have blurring together with contrast enhancement so you shouldn't focus on blurring as the key point.

Gew
7th August 2009, 16:41
If you are worried about the effect on thresholds for subsequent filters, you can look at a histogram of pixel values before and after to see what the resize operation has done.

That thingie did indeed sound interesting. How is this accomplished, in the easiest way possible? Also, is there any function that could help me find correspondant pixels before/after resize then? Cuz I'm a bit slow-minded so sitting with calc.exe and calculating what pixel y:325 x:123 in 640x480.avi would correspond to in 512x384.avi sounds a little bit harsh on my behalf ;P

Guest
7th August 2009, 16:44
Use the Avisynth Histogram() filter.

After the resize, use point resize back to the original size. Then the pixel locations will be the same. :)

Gew
7th August 2009, 16:49
Btw. Perhaps I could simplify all this by just assuming that (your quote)..

The output pixels combine information from multiple input pixels, so in that the sense there is blurring.

..really corresponds well to how the other guy ment that BilinearResize() downsize would cause TemporalSoften() to cover a few more spots w/ the same temporal luma/chroma threshold setting. Is this correct, in simple terms? Please say yes.

Guest
7th August 2009, 17:00
You're confused a bit, it seems. The "blurring" that a resize operation does is spatial. But TemporalSoften() is a temporal filter. So unless the resize generally increased/reduced the levels of pixels (which is unlikely), then the TemporalSoften() filter cannot "see" its effect. So your claim appears to be false.

Gew
7th August 2009, 17:21
You're confused a bit, it seems. The "blurring" that a resize operation does is spatial. But TemporalSoften() is a temporal filter. So unless the resize generally increased/reduced the levels of pixels (which is unlikely), then the TemporalSoften() filter cannot "see" its effect. So your claim appears to be false.

Confused indeed, and it hurts my head! :confused:

I here quote how the other guy explained why (2D) resize would affect (3D) temporal smoothening:

You should see a little difference between BicubicResize() before or after a temporal smoother. BicubicResize() is a sharpening resizer so it will enhance noise a little bit (ie, increase the contrast of the noise). If you resize first, noise right below the threshold for temporal smoothing may be bumped up just above the threshold.

And then, after I encountered him with the idea of using BilinearResize() instead, to get more equality in smoothing result:

I think there will still be a little difference because BilinearResize() will cause some of the noise just above the temporal filter's threshold to fall below the threshold. Again, the differences will be very minor.

Are these statements false? Or is there some misunderstanding, something I tend to be easily lead (and lead) into! :o

Guest
7th August 2009, 19:43
I suppose there could be a small effect but instead of theorizing you ought to just run some tests.

Gew
7th August 2009, 20:24
I suppose there could be a small effect but instead of theorizing you ought to just run some tests.

True. I tried just adding Histogram() to a sample but I must admit I'm too much of a newbie to even understand the colorimetry/luma values or/and how the graphs are to be interpreted. Besides, taking my theory into a test would presumably require neat clips that fulfill some of these demands, eg. spots and suchlike. I've [truth to be told] never run across a moment where I have actually had reason to use those theoretical details, but it just struck me as a must-know sort of thing, if you feel me. So, to even this one out, since you seems to know a whole lot more about resizing algorithms and how they work; IF there would be such thing as minor differences here, does it then seem conceivable to you that they (Bicubic VS Bilinear) would carry that "threshhold nudge" each on one side of the baseline, eg. like quotes above states.

Big sum up on question at issue:
Can I could use "Bicubic will slightly overtune; Bilinear will slightly undertune" (opposites!) as a rule of thumb.

Ty in adv.

Guest
7th August 2009, 21:04
Can I could use "Bicubic will slightly overtune; Bilinear will slightly undertune" (opposites!) as a rule of thumb. As I said, i think you have to test this thesis.