I'd like to calculate size of object in a photo which includes both a target object and a reference one.
I think what I'd like to do is what this software achieves (I don't know how precise this software is) https://itunes.apple.com/us/app/photo-meter-picture-measuring/id579961082?mt=8
I've already found, in general, it's called photogrammetry and seems active research field.
How would you find the height of objects given an image? https://physics.stackexchange.com/questions/151121/can-i-calculate-the-size-of-a-real-object-by-just-looking-at-the-picture-taken-b
But, I can not find
- what is basic way to measure a object in a photo with a reference object.
- a way to implement it or standard open source for it.
Update
- I can not utilize the distance of the object and reference from the camera.
- The reference and target are on the (approximately) same plane.
The most basic way is to simply determine the pixel dimensions of your reference object and use the metric dimensions to derive a mm / pixel factor. Then multiply the pixel dimensions of the object you want to measure with that factor. This only works if both objects are within the same plane parallel to your sensor.
For anything else you require distance information. You can either measure them or make some asumptions depending on how accurate you have to be.
The way to implement such measurements depends on your requirements.