Sea shell, with scale bar drawn by help of graph paper

Images taken in a controlled environment or with a posed subject. All subject types.

Moderators: rjlittlefield, ChrisR, Chris S., Pau

Stanley
Posts: 83
Joined: Sun Aug 02, 2009 2:34 pm
Location: Towson MD

Sea shell, with scale bar drawn by help of graph paper

Post by Stanley »

I have photographed some kind of sea shell that I have had carefully lying around the house.

Actually, however, my main concern had been constructing a scale bar relying upon the excellent suggestions put forward by Rik.

But first, the idea occurred to me of photographing my object (the sea shell) on metric-sized graph paper. As I imagine you all know, you can download graph paper for free to just about any dimension you may want, and use either the inch-pound system (not for me) or the metric system. You can choose a number of options as well. So I constructed graph paper that had squares of half a centimeter on each side.

I overlaid the sea-shell on that. Then, using auto-focus with my Nikon Coolpix 4500, I focused on the top of the sea shell so that the graph-paper squares were quite out of focus.

Next, being as careful as I could to not move the camera, I focused on the bottom of the sea shell so that the graph-paper squares were exactly in focus.

Despite my efforts not to move the camera, some movement was inevitable. I loaded both images into the same Photoshop Elements file and did my very best to get the two images in registration. It was a difficult and time-consuming process -- so much so that I cannot see myself attempting it on every close-up that I take in the future -- and I doubt that the registration is perfect.

Incidentally, the length of the sea shell from top to bottom is somewhere between 9 cm and 10 cm.

Finally, using the graph paper showing on the bottom-focused image as a guide, it was easy to construct a scale bar.

Here is the bottom-focused image, with my scale bar and annotation applied:

Image

And here is the top-focused image, again with my scale bar and annotation applied. This would be my presentation photograph:

Image

I think that using graph paper was an interesting idea. Of course, one has to be in a controlled, studio environment to do it. And, as I said, overlaying and trying to register the two images is definitely not easy. If done correctly, however, it is a helpful method of finding the scale.

Again, Rik has been most helpful to me in developing my ideas.

Stanley

rjlittlefield
Site Admin
Posts: 23625
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

Interesting study. A couple of things to think about...

First, I'm confused about the scale. Your text says that the squares are "half a centimeter on each side", so 6 squares would be 3 centimeters. But the image is labeled with 6 squares as "3 mm". Offhand it seems like there's an error of 10X one way or the other. Am I seeing this wrong?

Second, I wonder how much effect perspective is having on this scale. If the shell is 9-10 cm high, then it seems to me that the graph paper is quite a bit farther away from the camera than the in-focus portion of the subject is. That means the graph paper looks smaller, and as a result, using the paper to measure the subject will produce a number that's too large. How much too large depends on the lens you used. If the lens has a short focal length, the error will be larger than if it's a telephoto. (There is a special type of lens system called "telecentric" that would have no error at all, but that's a topic of other postings that you can search for.)

I'm sorry if it sounds like I'm harassing you about this. That's not my intention. But it seems like you're very interested in getting this stuff correct, and I know from having thrashed around myself that some of these issues are very far from obvious.

Hope this helps...

--Rik

Stanley
Posts: 83
Joined: Sun Aug 02, 2009 2:34 pm
Location: Towson MD

Post by Stanley »

Hi Rik,

I am very glad that you responded to my posting. I really wanted to get your feedback (and, of course, that of anyone else as well).

First, yes, I made a 10X mistake. That should read 3 cm.

The issue of perspective did concern me quite a bit. Since I am shooting close up, the problem should be all the worse. Is there a way that I could use the graph paper and mathematically compensate for this (a bit of trigonometry?). I would like to be able to use the graph paper -- it seems like a good idea.

For additional information, I shot the pictures with my Nikon Coolpix 4500. The EXIF data that I have from my IrfanView program states that the focal length with which the photo was taken was 14.00 mm, and that the "focal length in 35 mm film" was 67 mm.

I should point out that I tried to choose a bad-case scenario. So I made my photo of a relatively long object (such as 9-10 cm) precisely to emphasize perspective issues.

Stanley

rjlittlefield
Site Admin
Posts: 23625
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

Stanley wrote:Is there a way that I could use the graph paper and mathematically compensate for this (a bit of trigonometry?).
Sure, but the process is more trouble and less effective than you might hope.

First, look into the front of your lens to see where the aperture appears to be. The apparent location of the aperture is called the "entrance pupil", and it's the center of perspective for the image. Following the usual rules for perspective projection, the apparent size of objects is scaled by 1/d where d is the distance from entrance pupil to object. Within a single image, you can measure d_subject and d_graphpaper, and multiply by the appropriate ratio.

However, that only handles the case where both graph paper and subject are measured in the same image.

Scale also changes as you change focus, because the lens moves with respect to the sensor plane. Even if you lock the camera on a tripod, take a picture with your graph paper in focus, then refocus on the tip of the shell and take another picture, you'll find that the graph paper spans a different number of pixels in the two pictures. So, if you measure the graph paper in one image and transfer that measurement to another image that was focused differently, you need (for precision work) to take that scale change into account as well.

To a first approximation, the change in scale due to refocusing is predicted by the basic lens formula that 1/f = 1/o + 1/i, where f is the lens's actual focal length, o is the distance from object to lens, and i is distance from lens to image (sensor). Unfortunately this first approximation can get pretty sloppy with some lenses. I don't know how good it is with your camera.

When dealing with perspective, you also have to think about how the viewer is going to interpret what they see. It's just a fact of life that stuff closer to the entrance pupil looks bigger than stuff that's farther away. When that happens, no single scale bar can accurately represent every part of the subject. You can reduce the change in scale by shooting with a longer lens from farther away, and you can cut the odds of misinterpretation by pointing specifically at something in the plane where the scale is accurate.

Of course you should also think about how much accuracy is really required in any particular case. For many purposes, all that's required is some general indication --- is this thing the size of a basketball, a golfball, a grain of rice, or a grain of salt? In that case, it's probably better to spend time thinking about what will communicate best, rather than agonizing over a percent or two of accuracy.

For a while, I labeled my high magnification scale bars in microns, since that made nice integer numbers. Then (duh!) I finally realized that most people have no idea what a "micron" is, let alone that the symbol for it is "µm". So labeling a scale bar as "100 µm" says nothing to most people, and more likely than not will just confuse and annoy them. It's far better to say "0.1 mm" so that people can quickly grasp "Hey, that's small!" even though they'd be hard-pressed to say how many of those units it would take to span a fingernail.

The principle of best labeling depends on the audience, of course. For microscopists, microns work great because that's what they're used to.

--Rik

Stanley
Posts: 83
Joined: Sun Aug 02, 2009 2:34 pm
Location: Towson MD

Post by Stanley »

Hi Rik,

Thank you for your reply.

I am going to go over your formulas carefully, because I want to make sure that I understand as much as I can. I may well have a question about the mathematics later.

For the time being, however, let me direct my attention to the latter part of your posting. I am paraphrasing, but you argued that we should try to be reasonable. To use your own words:
Of course you should also think about how much accuracy is really required in any particular case. For many purposes, all that's required is some general indication --- is this thing the size of a basketball, a golfball, a grain of rice, or a grain of salt? In that case, it's probably better to spend time thinking about what will communicate best, rather than agonizing over a percent or two of accuracy.
So you are saying that it may be quite difficult to remove all inaccuracy, but depending upon the audience some approximation may be entirely appropriate in any case. I agree -- although I still would like to know how to get as accurate as possible.

In a previous posting, however, you said the following:
. . . I wonder how much effect perspective is having on this scale. If the shell is 9-10 cm high, then it seems to me that the graph paper is quite a bit farther away from the camera than the in-focus portion of the subject is. That means the graph paper looks smaller, and as a result, using the paper to measure the subject will produce a number that's too large.
Well, so even with my seashell being 9-10 cm high, how much difference would that make in the scale bar. (To be sure, as an academic exercise, I myself want to know how much. That's why I am going to study your formulas as soon as I have the opportunity.)

My point is that, in the context of the first quotation above, isn't my method quite good. Would I be off by more than 100 μm?

Indeed, let me direct your attention to the link that you gave me a number of postings back, this one at http://www.photomacrography.net/forum/v ... php?t=4030 (Sorry, I don't know how to put a hyperlink onto a word in BBCode.) Even there, your subject is perhaps 5 mm or so in front of the ruler. Not as bad as my 9-10 cm, but still enough to yield a perspective problem. True?

So, I suppose that my point in this lengthy posting is to ask whether or not my method of using graph paper is really seriously flawed?

But, please, if it is, tell me so. You couldn't hurt my feelings, if that were your concern. I just want to learn.

Stanley

rjlittlefield
Site Admin
Posts: 23625
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

Well, so even with my seashell being 9-10 cm high, how much difference would that make in the scale bar.
How far is your lens from the front of the seashell?

If the seashell is 50 cm from the lens, and the seashell is 10 cm high, then the graph paper is 50+10 = 60 cm away from the lens. The ratio of distances is 60:50, so that's the ratio of scales also. A feature at the top of the seashell that is actually 5 cm long will span the same pixels as 6 cm at the graph paper, resulting in a 20% error. If the camera were farther away, the error would be less; if it were closer, the error would be greater.
Even there, your subject is perhaps 5 mm or so in front of the ruler. Not as bad as my 9-10 cm, but still enough to yield a perspective problem. True?
Not true. The ruler was shot by moving the lens/bellows/camera assembly as a unit until the scale was in focus. So the subject and ruler were shot with exactly the same optical arrangement and were thus at the same scale. It's true that the subject was perhaps 5 mm in front of the scale, but the lens/bellows/camera was moved back 5 mm then also. The article is not clear on this point.

Nonetheless, there is still a slight perspective effect in that example. Referencing the original stack HERE, I find that the stack was 54 frames with a focus step of 0.002". (Sorry, my table was manufactured in inches!) So, total DOF was 54*0.002*25.4 = 2.74 mm. With that lens at that magnification, the subject is about 50 mm away from the entrance pupil, so the ratio of apparent sizes between the front and rear of the stack is about 52.74/50 = 1.055 . If I size the scale bar to fit the middle of the stack, then the error splits half each way, so any particular measurement will be within +-2.8% .

This is a typical amount of error for most of my work. It's not difficult to hold the scale bar to around 1% with respect to the calibration tool, but because of perspective effects, there is often +-3% difference in the apparent size of subject features. As far as I know, this has never had any effect, but I'm driven to know what it is, just in case it ever does.

--Rik

rjlittlefield
Site Admin
Posts: 23625
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

this one at http://www.photomacrography.net/forum/v ... php?t=4030 (Sorry, I don't know how to put a hyperlink onto a word in BBCode.)
The trick is to split the url tag.

For example,
the original stack HERE,
is written as

Code: Select all

the original stack [url=http://www.photomacrography.net/forum/viewtopic.php?t=3935]HERE[/url],
--Rik

Stanley
Posts: 83
Joined: Sun Aug 02, 2009 2:34 pm
Location: Towson MD

Post by Stanley »

Hi Rik,

First, thank you for explaining the BBCode to me.

Now to the main topic -- wow!

Without doing a careful measurement, I would say that the lens was only about 5 cm from the lens. Since the seashell was 10 cm high, then the graph paper was 5 cm +10 cm = 15 cm away from the lens. The ratio of distances was 15:5, so my error was 300%! Ouch.

Using your words but with different numbers: "A feature at the top of the seashell that is actually 5 cm long will span the same pixels as 15 cm at the graph paper, resulting in a 300% error."

It's true that I went out of my way to choose a bad-case scenario. However, since my lens can get so close to the subject that I am photographing, the graph paper idea is a first-class loser. I see that now.

Stanley

rjlittlefield
Site Admin
Posts: 23625
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

Stanley, welcome to the wonderful world of non-contact measurement!

Your questions prompted me to revisit my own situation.

It turns out that Zerene Stacker reports a computed scale ratio between front and back of stack, that it gets from analyzing the images. So I ran through ZS the cricket face stack that I wrote about above. The reported value for scale change is 1.0456. That's pretty close to the value of 1.055 that I talked about in earlier posting here, but it's not close enough to keep me happy. (I can be a bit obsessive sometimes.)

Anyway, then I did what I told you to do and actually looked into the front of the lens to see where the entrance pupil is. I also set up the lens system again to give the same magnification as the cricket stack and measured the distance from subject to entrance pupil. It came out more like 60 mm, give or take a couple of mm uncertainty in the entrance pupil location. That's compared to the 50 mm guess that I used earlier. I also realized I was off-by-one on stack depth, since 54 frames is only 53 focus steps. Repeating the calculation using 60 mm instead of the 50 mm, and 53 steps instead of 54 frames, the predicted value comes out to 1.0449. Now that's close enough to 1.0456 to keep me happy.

Given the way that Murphy's Law works, there are probably a couple of fortuitous errors in here that are canceling each other out. But for the moment, at least, this is pretty good agreement between theory and practice.

--Rik

Stanley
Posts: 83
Joined: Sun Aug 02, 2009 2:34 pm
Location: Towson MD

Post by Stanley »

Hi Rik,

Thanks for the more exact numbers. I am going to study them carefully later, and it will be good practice for me.

Yes indeed, as you say,
. . . welcome to the wonderful world of non-contact measurement!
Stanley

Stanley
Posts: 83
Joined: Sun Aug 02, 2009 2:34 pm
Location: Towson MD

Post by Stanley »

I have a general question for Rik about optics (although, of course, anyone may jump in).

I found your explanation back a few postings ago so instructive that I have now thought about it quite a bit. Here is the sentence to which I am referring:
A feature at the top of the seashell that is actually 5 cm long will span the same pixels as 6 cm at the graph paper, resulting in a 20% error.
So let's just forget about photography for a moment. Let's say that I hold up the tip of my finger some distance from my eye, perhaps 25 cm as an example. That finger tip against the background of some object several meters distant seems much bigger than it really is. It's the same phenomenon observed with the photograph. Of course, this follows because, as you say,
It's just a fact of life that stuff closer to the entrance pupil looks bigger than stuff that's farther away.
Since we can't speak about pixels in this context (can we?), how can we mathematically express the situation?

In other words, how could we fill in the blank here:

"My fingertip that is actually 2 cm wide will span the same [fill in the blank] as 50 cm [for example] against the background, resulting in a 250% error.

Or am I asking an obvious question. Maybe the blank word should simply be "distance." Anyway, what do you think?

Stanley

rjlittlefield
Site Admin
Posts: 23625
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

Stanley wrote:In other words, how could we fill in the blank here:

"My fingertip that is actually 2 cm wide will span the same [fill in the blank] as 50 cm against the background
Try "angle". For most optical systems, the apparent size of something corresponds to the angle that it spans, with respect to the entrance pupil.

--Rik

Stanley
Posts: 83
Joined: Sun Aug 02, 2009 2:34 pm
Location: Towson MD

Post by Stanley »

Hi Rik,

Good. Now I understand.

So using hypothetical linear measurements, but correctly measuring the resulting angles, we would have the following formulation:

Let’s say that my fingertip is 2 cm wide. From a distance of 25 cm, my fingertip subtends an angle of a bit less than 4.6°.

Next, let’s say that I am looking at an object from a distance of 625 cm, and that the width of this object is 50 cm. Given this width and this distance, then the object also subtends an angle measuring exactly the same (a bit less than 4.6°).

So, my fingertip that is actually 2 cm wide, when viewed from a distance of 25 cm, will subtend the same angle as does a 50 cm object when it is viewed from a distance of 6.25 m.


And that wraps it up, I think. In photography we measure an apparent length by counting pixels (or having the computer count pixels). In nature, however, we measure an apparent length by measuring angles.

Rik, you are quite a teacher. I have learned so much in the last week-and-a-half that I am thrilled.

Stanley

rjlittlefield
Site Admin
Posts: 23625
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

Sounds like you have it nailed now, Stanley.

Thanks for the compliment. I'm glad the discussion was helpful.

I do teach, by the way. Math 101 at the local university campus. It's an unusual class -- classic algebra integrated with spreadsheet construction and use. I get a kick out of telling the students that they'll come out knowing some techniques that half the math faculty and most of the administration don't but should. Unfortunately, it's completely true!

--Rik

Wayne Baker
Posts: 47
Joined: Wed Nov 26, 2008 10:39 pm
Location: Melbourne, Australia
Contact:

Post by Wayne Baker »

Hi there. Wouldn't the easiest way to determine scale be by photographing a flat scale at your chosen magnification and then applying that known distance to the frame, thus giving you your scale?

For example, when my lens is set to 3X mag, I place a metal ruler in the field of view, which shows 12mm across the frame. As the frame is 36mm in width, this means I am at exactly 3X magnification at the sensor plane. With this information, I can then take measurements from the resulting image.

Of interest to myself and my university lecturers is the issue of perspective when using the multi-focused image fusion method.. I'll be hunting around to find some more info on that unless someone knows of anything already written?

Thanks!

Wayne ;-)

Post Reply Previous topicNext topic