supplierdeeply

Photogrammetry using Canon super zooms

  • 20 Replies
  • 3744 Views
Re: Photogrammetry using Canon super zooms
« Reply #10 on: 07 / June / 2014, 21:42:12 »
Advertisements
Wouldn't you need to be shooting with a script for that to work, in order for the script to get the subject distance value?
Yea - that was the "plan".

Quote
Writing the SD value to the DNG EXIF means it's available for calculating values at any time (either on the camera, or on a PC).
Obviously a much better choice once you get it working. Didn't mean to imply otherwise.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Photogrammetry using Canon super zooms
« Reply #11 on: 08 / June / 2014, 21:27:53 »
I appreciate the hassle of dealing with exif data, having attempted to read it with a vba application.  If is easier to append the data to a text file in the photo directory this would be fine.  Individual sidecar files would also work but are more fiddly.  I would also like to confirm that some photo editors show the subject distance information and other don't.  I can confirm that the sx50 does write the subject distance in the exif data but I don't know the units.

*

Offline philmoz

  • *****
  • 3070
    • Photos
Re: Photogrammetry using Canon super zooms
« Reply #12 on: 08 / June / 2014, 22:11:08 »
I appreciate the hassle of dealing with exif data, having attempted to read it with a vba application.  If is easier to append the data to a text file in the photo directory this would be fine.  Individual sidecar files would also work but are more fiddly.  I would also like to confirm that some photo editors show the subject distance information and other don't.  I can confirm that the sx50 does write the subject distance in the exif data but I don't know the units.

The exiftool program (http://www.sno.phy.queensu.ca/~phil/exiftool/) can be used to view pretty much any image metadata. For Windows there is also a GUI interface for exiftool (http://u88.n24.queensu.ca/~bogdan/). You can use the command line with exiftool to extract specific tag values from image files.

On my cameras (G12, G1X & SX40) the 'FocusDistanceUpper' value that Canon writes to the JPEG files is measured in meters; but appears to be truncated down to the nearest centimeter.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)

*

Offline reyalp

  • ******
  • 11339
Re: Photogrammetry using Canon super zooms
« Reply #13 on: 15 / June / 2014, 02:01:13 »
I'm testing a mod to add the 'SubjectDistance' tag to the DNG EXIF data, so at least it would be available in CHDK DNG files. For close focus distances it's fairly accurate.
I noticed using "focus at infinity" on my elph130 this ends up being shown as -1/1000 in raw therapee and -0.0 in irfanview.

Unless there is a standard for "infinity" we should probably just use some arbitrary large number.

edit:
It is tagged as a "rational" rather than srational, so technically these programs are at fault for treating it as signed.
« Last Edit: 15 / June / 2014, 02:06:47 by reyalp »
Don't forget what the H stands for.


*

Offline philmoz

  • *****
  • 3070
    • Photos
Re: Photogrammetry using Canon super zooms
« Reply #14 on: 15 / June / 2014, 02:36:45 »
I'm testing a mod to add the 'SubjectDistance' tag to the DNG EXIF data, so at least it would be available in CHDK DNG files. For close focus distances it's fairly accurate.
I noticed using "focus at infinity" on my elph130 this ends up being shown as -1/1000 in raw therapee and -0.0 in irfanview.

Unless there is a standard for "infinity" we should probably just use some arbitrary large number.

edit:
It is tagged as a "rational" rather than srational, so technically these programs are at fault for treating it as signed.

Any suggestions for the value?
2^31 - 1 will fix the sign issue; but isn't a very meaningful number.

Canon use 65535 in the FocusDistanceUpper tag (shows as 65.53m).

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)

Re: Photogrammetry using Canon super zooms
« Reply #15 on: 15 / June / 2014, 08:44:33 »
Any suggestions for the value?
What about the #defined CAMERA_MAX_DIST in platform_camera.h ?
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3070
    • Photos
Re: Photogrammetry using Canon super zooms
« Reply #16 on: 15 / June / 2014, 09:07:40 »
Any suggestions for the value?
What about the #defined CAMERA_MAX_DIST in platform_camera.h ?

That's another possibility, although I was thinking a common value for 'infinity' across cameras might be more easily understood.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)

Re: Photogrammetry using Canon super zooms
« Reply #17 on: 15 / June / 2014, 09:18:46 »
That's another possibility, although I was thinking a common value for 'infinity' across cameras might be more easily understood.
I seem to recall some talk about some cams using a 16 bit value (hence the 65535) and others a 32 bit value?
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline philmoz

  • *****
  • 3070
    • Photos
Re: Photogrammetry using Canon super zooms
« Reply #18 on: 15 / June / 2014, 15:47:07 »
That's another possibility, although I was thinking a common value for 'infinity' across cameras might be more easily understood.
I seem to recall some talk about some cams using a 16 bit value (hence the 65535) and others a 32 bit value?

AFAIK, they all use 0xFFFFFFFF to mean infinity.

Phil.


CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)

*

Offline reyalp

  • ******
  • 11339
Re: Photogrammetry using Canon super zooms
« Reply #19 on: 15 / June / 2014, 16:30:30 »
After a bit of googling, I found https://www.flickr.com/groups/d7000-club/discuss/72157629452791882/
ignoring the people trying to make 2^32-1 a real distance... it leads to the CIPA spec which says

Quote
SubjectDistance

The distance to the subject, given in meters. Note that if the numerator of the recorded value is FFFFFFFF.H, Infinity shall be indicated; and if the numerator is 0, Distance unknown shall be indicated.
So, phil's original code is right, raw therapee and irfanview are wrong. Since it's actually specified in the spec, I'd say leave it as is even though some programs are confused.

edit:
I apologize for the tangent  :-[
Don't forget what the H stands for.

 

Related Topics