> 
> 
> 
> John Francis wrote:
> 
> >
> >OK - here's as close to the RAW sensor data as you are likely to get.
> >
> >    <http://panix.com/~johnf/temp/pef1127.jpg>
> >
> >The only processing done here to go frow raw sensor data to RGB is:
> >
> > o  Fill in missing sample values (average of closest neighbours)
> >  
> >
> 
> I'm wondering, do you think that the average is very fast, but probably 
> sub-optimal, as it doesn't take into account any 1st & 2nd derivative 
> effects? What do the other mechanisms use, bilinear or bi-cubic, or 
> something else I wonder?

I picked simple averaging (which *is* bilinear interpolation) not so much
because it is fast (not really important; the file I/O time dominates)
but because it was easy to implement as a first test.

My initial effort is concentrated on getting the colour balance right;
if I can't get the correct colours then nothing else really matters.
Once I've got over that first hurdle I'll look at using a better initial
interpolator.  It _is_ important; it's the foundation on which all the
later adjustments depend.  Equally, though, it's important not to make
the wrong choice - artifacts introduced at this stage are extremely
hard to remove later.  I'll probably use a slightly larger filter kernel
to take into account more than just the closest neighbours.  It's not
really appropriate to talk about bicubic or biquadratic interpolation,
because the registration of the grids means we would only evaluate the
function at a single point.

>                               Is the matrix designed to be treated as a 
> square, or is there (x,y) information directly annotated or implicit in 
> some fashion?

I haven't got the faintest idea what you are talking about here.
 
> > o  Scale the R/G/B values based on what I believe to be the white
> >    balance scaling stored in the raw file by the camera.
> >
> John, where is that info in the file, is it a tag, or just some internal 
> field?

Based on my reverse-engineering of the PEF format, it's a (Pentax private)
tag inside the MakerNote data structure, which itself is pointed to by the
MakerNote tag in the EXIF IFD, which in turn is pointed to by the EXIF tag
in the primary image IFD.

Reply via email to