Making an app to measure lengths from camera data

Hi,

I’ve been on iNaturalist for a few years now, and recently had a thought I wanted to check out. I’ve made an app (waiting for Mac App Store publishing) that uses your camera’s EXIF data to allow the user to measure a subject. It’s obviously not going to be accurate to the millimeter or anything, but in my (so far fairly limited testing) is pretty accurate.

The app is called CamMeasure [I’ll update this post when it’s actually available on the Mac App Store (free, obviously)], as I think it can be useful for the community.

It comes with a few caveats:

  1. The subject being measured must be in focus (it works by pulling the focus distance from the lens metadata), though you can also manually supply the distance (if measured by some external source).
  2. The data is really bad for super far away subjects (like 150m+ if using focus distance from the lens metadata) (the app does warn the user about this)
  3. The distance being measured needs to be pretty perpendicular to the camera (if you take a photo of a bok running away from you, it can’t determine the length from butt to head)

But so far, it’s been pretty accurate.

Couple nice features:

  1. Built in sensor size support for most modernish (like last fifteen years) cameras (sensor size can be manually added if it’s not supported)
  2. Can handle cropped images (the crop data is extracted from the cropped image’s metadata, otherwise the full width can be manually input as well)
  3. Requires no external libraries or anything
  4. Free (completely)

Just gauging interest here to see if this something people (besides myself) may find useful. Again, it’s free.

The app could be really interesting for macro work with moths, e.g., where size helps in ID for similar species. Has it been tested for close-up subjects? Can you control where the app takes the measurement?

Can a measurement be corrected based on an object of know size in the photo? For example in your bird photo, if I knew the diameter of that post was 47mm, could I measure that and the bird and have it tell me that the bird is actually 77mm long?

I’m afraid lens metadata from phones start being unprecise before 150+ meters, but I’ve heard Iphones have special distance measuring features (lidar or whatever) which might help (I have android, so I can’t really tell - I guess anything beyond a few meters is at infinity for a lens with 3 millimeters of aperture). Your example seems to be from a real camera, there the result might be better.

What one might try is to take several shots from different positions (ideally with a known separation between them) and use the parallax to compute the distance. The problem is known as “bundle alignment”, and I guess there are apps for architecture/construction or other businesses that do this. It seems every hobby/profession suffers from that problem, up to the Hubble tension ;-)

Yes, this is mostly designed for dedicated cameras rather than phones. Well it’s entirely designed for dedicated cameras rather than phones. I hadn’t even considered phones when I was creating this.

Focus breathing is the main issue here, but I’m in the process of designing a calibration suite that should offset that. Initially when the app goes live, it will only have the calibration data for the lenses I personally own but has a calibration wizard for users to calibrate their own lenses, and (optionally) upload that calibration data.

Yes! I’ve added that. Great suggestion. Along with my previous comment, you can also save that to the lens’s calibration profile, to add greater precision.

I actually do not have any macro lenses to test this out on. I should have a support website up for the app shortly (maybe next week), and if you’d like to submit a few calibration shots of your own, that would be greatly helpful.

You can specify the focus distance if it’s known, but by default it uses the lens’s reported focus distance to determine that.

Just a heads-up that on this forum you can select text you want to respond to, then click Quote, and the text will be included in your post. You can then reply to multiple posts in one post, which makes things a bit cleaner. :-)