How does On1PR 2021 calculate Exif data?
I suppose you think the answer to this question is obvious but it is not. I will tell you the reason for my question.
My equipment: Sony alpha 6500 + Zeiss 16-70 f / 4.
I usually shoot with the hyperfocal distance in mind.
Working with a RAW file on my On1PR2001 I checked for an unwanted blur and to make sure it had not been an error in choosing the focus distance, I went to the Exif data that the program shows in the Info section of the Browse module, I expected 20 m more or less and to my amazement the program indicated "Focus Distance 1.98 m"?
I checked with different lenses, fixed, zoom in their different focal points and with two different bodies and in all cases the data is incoherent and far from reality.
How does the program calculate this data? And what is this “Focus Distance” data for?
Is it a program error or am I misinterpreting the data?
-
Sorry, I took the values from another example. The correct values for the 50 mm lens are:
- 33.7950414791673 (with 'FocalLengthIn35mm Format'). This value is shown by exiftool as 'Focus Distance 2'
or
- 22.5300276527782 (with 'Focal Length'). This value is shown by PhotoRAW.
0 -
Sorry, I took the values from another example. The correct values are:
- 33.7950414791673 (with 'FocalLengthIn35mm Format'). This value is shown by exiftool as 'Focus Distance 2'
or
- 22.5300276527782 (with 'Focal Length'). This value is shown by PhotoRAW.
0 -
¡Magnifico Holger¡
Intentaré entender la formula, en principio me choca ese denominador del exponente(16-5), no obstante esta misma tarde me pongo a trabajar con la formula. Si como parece ese es el nexo entre la información On1PR y Exiftool, habrás encontrado la respuesta a una de las preguntas, nos falta encontrar la distancia real al objeto.
0 -
I included a link to this thread in my message to the engineers. Hopefully they will come here and read what has been found. I wouldn't expect them to respond here, although they might. Or they could respond directly to me in which case I will report here what they have to say.
0 -
@Antolin: be careful, the exponent is focusposition/16-5
I found the following quote:
"There are no distances in the Exif data. There is only one entry for the approximate focus position, which can have values between 0 and 255. The relationship between this information and the distance in meters is not officially documented. Programs like ExifTool try to use empirically determined functions to calculate/estimate the actual distance. It is not certain that the conversion function is correct or accurate."
0 -
Is that 16 minus 5 or (focusposition/16) - 5?
0 -
(focusposition/16) - 5, which is the same as focusposition/16 - 5. At least here in Europe ;-)
0 -
As long as you understand order of operations, yes. 😁 I figured that was it, I just wanted to make sure. Thanks.
0 -
@Brian: here is a tiny Perl program to calculate these values. Perhaps Perl is installed, when you run exiftool from the command line.
----------------------------------------
#! /usr/bin/perl
#
# formula: ((2^(focalposition/16-5) + 1)*focallength) / 1000
#use strict;
my $position = 221.0;
my $focal = 50.0;
my $focal35 = $focal * 1.5;
#my $focal35 = $focal; # for full framemy $exp = $position/16.0 - 5;
my $exiftool = ( (2**$exp + 1) *$focal35) / 1000;
my $photoraw = ( (2**$exp + 1) *$focal) / 1000;print "$exiftool $photoraw\n";
----------------------------------------
0 -
I'm a software engineer too. Yes, I've got Perl and I've got the ExifTool source code, I just haven't started digging into it yet. I'm still working through Lensfun code. One API at a time. 😃 😎
Thanks for the code.
0 -
One short addition for Canon CR2 files:
the calculation is different as for ARW files, because two tags 'Focus Distance Upper' and 'Focus Distance Lower' are used. Both tags are written as unsigned integer and ExifTool multiplies these values only with 0.01. If 'Focus Distance Upper' is greater than 655.345, ExifTool transforms it to 'inf' (infinity).
The values for 'Focus Distance Lower' and 'Focus Distance Upper' represent the range, where the lens was focused. There is no real distance measure for the subject.
PhotoRaw always shows 'Focus Distance Lower'.
0 -
👍👍👍👍👍👍👍👍👍
CONGRATULATIONS HOLGER
The formula that he has found is exact, as you can see in the attached excel the coincidence is total in all the photographs.
You can see that in some the focal length was accidentally changed when manipulating the camera.
Unfortunately I have not been able to find Focus Distance in the Exif data, I have to spend some time testing Exiftool in command mode to see if I can find the parameter.
I hope that the Technical Service will thank you for your contribution.
It would be very nice if the Technician could tell us what function this information fulfills in the program and the reason why it has been titled "Focus Distance"
Thank you all for your interest.
0 -
I was wondering if perhaps the solution would be to post both upper and lower figures as a 'field of focus' or depth of field.
0 -
Here's a stupid question. Since Circle of Confusion, Lens Aperture, Lens Focal Length and Focus Distance are all used to calculate DOF Near point and DOF Far point, would it not be possible to solve for Focus Distance knowing COC, Lens Aperture, Lens Focal Length, DOF Near Point and DOF Far point?
I'm looking at the equations trying to figure this out myself but I'm terrible at algebra.:-(
This assumes 'Focus Distance Upper' and 'Focus Distance Lower' in CR2 files are equivalent to the actual DOF values which I would guess they probably are.
0 -
Brian, the ethical solution would be for the program to give what it offers, the Focus Distance and otherwise not offer it.
Put to dream, the ideal would be for the cameras to be the ones that when focusing would give us both the focus distance and the hyperfocal distance. Dreaming is free.
0 -
I was thinking about this too and why the camera does not include that information already. The only thing I've come up with so far is that it would require some kind of targeted ranging system to measure the distance to the object the camera has focused on. That could be complex and it might not be right.
If the program reports the data that is provided accurately, that is ethical IMO which is why I thought representing the upper and lower limits as a DoF reading would work. If that is what those values actually represent.
If it is unknown what they represent then yes, they should not be displayed with a misleading label. Is it possible the engineers are unsure themselves? I don't know. Hopefully, we'll hear back from them.
0 -
Brian, After a few hrs of work I have figured out that indeed you can use the Focus Distance Lower from CR2 files ( which is the value reported in Photo raw ) and of course knowing Aperture and focal length. I did three test photos measuring the distance from camera to subject. In all three instances using the Focus Distance reported in photo raw as the Near DOF value I was able to calculate the Distance to subject within 3 inches in one case. There was some variability as I was hand held and moving around a bit. Also rounding errors. All that said at least for my camera, 5DIV, I am pretty confident the number reported in Photo Raw is accurate knowing it is the Near DOF value.
0 -
I just found this on the ExifTool forums. It is from Phil Harvey, the author of ExifTool. It was in reference to Canon 400D/XTi. I'm still looking for info on the .cr3 format in case it is different.
"But the bad news is that the upper/lower distances don't represent the range of distances that is in focus. But the bad news is that the upper/lower distances don't represent the range of distances that is in focus. They represent the accuracy of the measurement. There are only about 10 or so steps in the focus distance range, and these two values are the bounding steps. Adobe just takes the average of these two values to approximate the focus distance."
Plugging in my numbers without units I get numbers that are much closer to my actual focus distance as long as I read them in feet. I get 36', way off, 16' pretty close, and 9', also pretty close. (20', 15', & 10' were the actual distances.)
0 -
Did you use Holger's equation for Sony files or something else?
0 -
I used the information in this article as a starting point.
Depth of Field, Part II: The Math | B&H Explora (bhphotovideo.com)
Then assumed everything was known except for Focus Distance. The followed these instructions to solve
Like I said I'm really bad at math so had to have a little internet help ;-)
I the example below I was using
Hyperfocal Distance 10416.7 ( Calculated using formal in attached article
Focal Length 50
Focus Distance 10'
Aperture F8
0 -
Thanks. I just finished updating my message to the engineers with a summary of what we've found.
0 -
Thanks Brian, I have to say following these types of discussion is very fun and informative. I have now built my own DOF calculation spreadsheet with the ability to calculate actual focus distance if I was ever so inclined. Good exercise for the brain!
0 -
Agreed. I'm a geek too. 😎
0 -
Creo de interés para todos los participantes en este hilo, la ultima respuesta que he recibido de On1 a mi requerimiento de atención.
Creo que podemos sentirnos satisfechos y lo estaremos mucho mas cuando la actualización se haga efectiva.Saludos a todos.
Cody Armstrong (ON1)
Sep 15, 2021, 8:33 PDT
Hello,
After consulting with our QA team they have deemed this to be a bug in the software.
They have written up a report and sent it to our development team so that they can begin working on a patch or update to resolve this.
As soon as that patch or update is available for download we will let you know.
Please let us know if we can be of further assistance.
Regards,
Cody | On1 Technical Support
0 -
Sorry, I forgot to translate.
I think of interest to all participants in this thread, the last response that On1 received to my request for attention.
I think we can be satisfied and we will be much more satisfied when the update becomes effective.Greetings to all.
0 -
Good to hear Holger.
Thanks everyone for participating and helping to get a better understanding of all this.
0
Please sign in to leave a comment.
Comments
56 comments