A camera produces an image that loses any scale information. That is because the projection is flat (or spherical, depending on the lens geometry). Objects at different distances appear sized differently. Likewise certain objects can appear the same.
Image 1: The projection loses sense of scale.
By placing a measurement in an image you can re calibrate a single plane, if the camera is orthogonal to that plane. If the measurement a square, but not 2 edges then you can can also account for perspective distortion so camera need not be orthogonal anymore.
If the object is 3-dimensional then you can not use a single image to measure the object. But you can use 2 images, or preferably more than 2 images. This is called stereo geometry (for a fun explanation see the fundamental matrix song). Of course you should also eliminate the camera distortions. Quite many scientific and commercial packages exists for this. Ones that i have used are:
- Tracking software like:
- OpenCV a programming framework for visual related algorithms
- Matlab
Now it's worth noting that you still must know ONE dimension in the image or setup otherwise you only get the relative distances between points. So still the image loses scale, to fix this you need to know one dimension.
You can get pretty accurate measurements with this, but consider using structured light methods.