Log in

View Full Version : is such a resizer algorithm exists?


vinetu
16th April 2005, 21:57
This is a truly theoretical question.
Imagine you have a video which was shoted by 2 CCD sensors (with a splitter prism behind the lenses)
and the sensors are shifted by 1/2 pixel diagonally each other.Overall the 2 images will look exactly the same,
but on the pixel level they will by different-lets say we have a thin wire diagonally on the flat background - both the CCD1
and CCD2 images alone will look as "zig-zag" ,but the "zig-zags" will be from different POV (CCD2 image contain data not present in CCD1 and vice versa).
So an upsizer algorithm which combine the data from both CCDs will give much better look if we upresize 4 times for example.
The easy way is blending ,but what would be the hard way ?

...ah and the pixel shift is not "hard coded" to 1/2.

Mug Funky
17th April 2005, 14:59
i could imagine edge-directed methods could work from hints received from the other CCD.

i'd like to see something like this in the lovely DCRAW program to give better edge resolution on 1-CCD bayer style images:

- make an edge-mask of each "channel". edge-masks should reduce the difference between each colour's samples

- use the edges as some kind of hints to a clever resampler (EDI? i don't know much about these algos).

your problem seems similar, so if you come up with a solution, email it to the DCRaw developer :)

vinetu
17th April 2005, 18:06
indeed it's not a "problem" -I just free some thought about that clever resampler.

And the idea is coming from "Denoise useing Average of N analog captures"
i. e. - take 2 or 3 streams as input and give 1 better quality as output

trevlac
20th April 2005, 19:45
Well ...

If you knew the 1/2 pixel sample points ... wouldn't you just interleave them? You'd still have to interpolate 50% of the new pixels for a 4x resize. So you'd zero pad those unknown points and run something like a Lanczos across them to interpolate. This would result in a 4x picture with 50% of the samples being 'original', where as only 25% are normally original.

You could simulate this by starting with a big picture:
- Original Nearest Neighbor Decimate by 4 x == CCD1
- Original Shift down and over by 1 col/col
- Shifted Original Nearest Neighbor decimate by 4x == CCD2
- Interleave, Zero pad, Convolve

----------------------
Come to think of it ... a simpler example would be to only work in 1D.
CCD1 = NNDecimate(Orig)
CCD2 = Shiftby1(NNDecimate(Orig)
New = Weave(CCD1, CCD2)

Which probably simplifies to new = SeperateFields(Orig).Weave()