Panasonic Raw Extraction Broken in 9.0

Started by andrewj, August 29, 2012, 04:36:47 PM

Previous topic - Next topic

andrewj

That will work for me, but I'm trying to run a project with several participants, and then I want to build the lens correction logic into a plugin available to all users of Bibble or ASP. I can't place that restriction on that whole community.

Thanks
Andrew

Phil Harvey

Hi Andrew,

Quote from: andrewj on September 01, 2012, 12:33:00 AM
1. Can I build the user defined tag in the same command line which uses it, in a way which will work across platforms?

No.  There is no mechanism to do this.

Quote2. Can you build this in as a "standard" user defined tag?

There are no "standard" user-defined tags (other than the ones in the sample config file).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

MOL

Andrew,

What about hard-coding the config file that Phil was talking about, and writing it to a temporary file when your plug-in is started? Then you could simply run the config file through ExifTool and access the data you need. Wouldn't that work for you?

Uwe

andrewj

@Uwe - Thanks. I'd come up with a similar scheme myself, and I think it will work, so that will solve my immediate problem.

@Phil - I am worried that exiftool now only has a known, invalid interpretation of this data. I still think that it would make most sense to make the integer array available directly as well. I will keep you posted as we find out more about the data, but please review whether the current approach is the right one.

Thanks all,

Andrew

Phil Harvey

#19
Thanks Andrew,

I'm glad you figured out a way to work with the user-defined tag.

The decoding of this information will certainly evolve as more is learned.

About your web page:  I can't find any mention of the actual formula that you are using.  Raphael gives his formula (although he fails to explain his variables), but his A and C are reversed compared to yours.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

andrewj

Hi Phil,

There's a second page under the link "known algorithms" which lists all the algorithms I've identified so far:
http://www.andrewj.com/mft/algorithms.asp

Hopefully this gives you a feel for the potential complexity.

Andrew

Phil Harvey

Hi Andrew,

Thanks, but I saw this page already.  This page just lists the way you calculate the constants for some formula, but I don't see the formula.  Raphael used this formula:

    Ru = scale*(Rd + a*Rd^3 + b*Rd^5 + c*Rd^7)

but didn't explain the meaning of Ru and Rd (although I think I can guess).

It seems your formula is different.  Perhaps this:

    Ru = scale*(Rd + a*Rd^7 + b*Rd^5 + c*Rd^3)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

andrewj

Dear Phil,
The formula doesn't change, it's just the standard formula for lens geometric correction (see, for example, WikiPedia), and is embedded in the RAW processing software. "All" we have to do is work out the parameters a, b and c. These should derive from the MFT data, but it's not a 1:1 correspondence.

Andrew

Phil Harvey

#23
Hi Andrew,

Maybe I'm stupid, but I just don't get it.  Wikipedia describes Brown's distortion model, which is a completely different formula, not involving a, b or c at all.

It could be that your a, b and c correspond to K1, K2, K3 in the Brown's equation (and the tangential distortion coefficients are all zero?), but this is different from Raphael's equation which used powers of 3, 5 and 7 and not 2, 4 and 6 as in Brown's model.

- Phil

Edit: Also, you still haven't explained why your "a" and "c" are reversed from Raphael's.
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

andrewj

Hi Phil,
Maybe you have hit on one of the sources of confusion. I have a RAW processor into which I can put three values labelled a, b and c. I assumed that these are the same as in Raphael's model, but I had established that a and c seem to be reversed between the two. You have spotted that this may not be the case. I will do some more research and confirm whether or not the formula used by Bibble is the same as Raphael's or a different variant.

I haven't seen anything which explains how the formulae which use even powers relate to the formulae which use odd powers. Assuming it's not just a simple factorisation then this could also explain why I am getting different results, and in some cases the variation doesn't seem to be linearly related to the data in the RAW.

I think fundamentally a, b and c are equivalent (but via some translation I don't yet understand) to K1, K2, K3 etc. I suspect tangential distortions can be ignored as no lens in the MFT class has these by design. However some of my own experiments suggest that there may be cases where the ideal correction is different in two axes, which would be supported by the Browns equations and the number of data points in the RAW data, but as far as I am aware most image processing programs only allow for three parameters and assume radial symmetry.

I'll investigate further and keep you posted. If you have any moments of inspiration please let me know,
Andrew