Hacker News new | ask | show | jobs
by foldr 1715 days ago
I think you are right if you hold constant the CoC. In that case the DoF is proportional to the f number but inversely proportional to the square of the focal length (http://graphics.stanford.edu/courses/cs178/applets/dof.html).

However, for a smaller format, we arguably ought to reduce the CoC proportionally. And I think that reduction will end up canceling out one factor of f, bringing us back to the ratio of the focal length to the f stop (i.e. the absolute diameter of the aperture).

1 comments

The focal length input is squared, but the CoC impact is linear. The iPhone has a small CoC compared to SLRs, but its input on the calculation is undersized relative to focal length.

The iPhone is widely assumed to have a CoC of 0.004mm (this actually increases on the most recent iPhone, though it's tough to get precise numbers). A Nikon D5000 (going with an equivalent resolution -- larger pixels -- on an ASP-C camera) has a CoC of 0.020.

So let's calculate hyperfocal distance of the two systems for the same effective focal length (but obviously very different real focal lengths)-

iPhone 12 telephoto lens - 65mm (7.5mm real) equivalent, f2.2.

Nikon D5000 equivalent lens - 65mm (43mm real) equivalent, f2.2.

For the iPhone, the HF is 6.4m. For the Nikon, it is 54.3m. For those who don't know, hyperfocus is the point where everything from 1/2 of that distance to infinity is in focus if you set the focus to that magical point. It's a proxy for the other depth of field calculations, and is the simplest to demonstrate.

Anyone who owns an iPhone w a "telephoto" and an ASP-C SLR w/ a 50mm lens needs to try to replicate bokeh at various distances without the computational bokeh. Focus on a subject at 1m, 2m, 4m, etc at the same aperture. Close down the aperture on the SLR even.

Holding constant the target resolution, you need a smaller CoC in proportion to the difference in focal lengths (assuming the viewing angle is also held constant). That removes one of the factors of f.

I think it makes sense to assume the same target resolution for the iPhone and the DSLR, even though this isn’t true in practice. The DSLR user is obviously free to downsample their photo to a lower resolution and thereby (in a rather uninteresting way) gain more depth of field. We shouldn’t be giving the iPhone extra DoF points just because it happens to have a lower resolution.

So we are not talking about any empirically derived value for the iPhone’s CoC. The CoC here is a value derived for each format from an arbitrarily chosen target resolution.

"I think it makes sense to assume the same target resolution for the iPhone and the DSLR, even though this isn’t true in practice"

It yields a practically perfect comparison of focus. This isn't a trick or handicapping, and the degree of focus/defocus is identical whether that SLR had 10x the resolution. There is utterly nothing arbitrary chosen here, and the amount a tree 10 feet outside the focus is out of focus will be identical on a 12MP SLR or a 24, 48, or 96MP version with the same focal length / f / sensor size.

My point was that it doesn’t matter what resolution we choose as long as we do the calculations based on the same resolution for both the iPhone and the DSLR (and hence with different values for the CoC in each case, given the different sensor sizes). Thus your value for the iPhone’s CoC derived from its pixel size is irrelevant. We can choose any target resolution we like to make the comparison and get the same result (comparatively speaking).

By resolution here I’m talking about what we could crudely measure in megapixels. Say for example that we have a target resolution of 5MP. We then calculate the corresponding CoC for both cameras based on their respective sensor sizes. You’ll find that the CoC for the iPhone will be smaller in proportion to the difference in focal lengths between the iPhone and DSLR. That cancels out one of the factors of f.

Sudosysgen is saying the same thing, but without going indirectly via the DoF formula that you’ve been using.

The CoC for the iPhone is smaller than the ASP-C given the smaller sensor. By choosing the same resolution of an ASP-C sensor, we are calculating for a given level of "good enough for that resolution". It is perfectly comparable level of focus. I have no idea why you are so caught up in distractions.

I calculated the hyperfocal length for an iPhone and an equivalent zoom SLR, at the same aperture. These yield effectively identical degrees of focus from 1/2 the HF to infinity. The iPhone is from 3.2ft to infinity, the SLR is from 27 feet to infinity.

Nothing else matters if you can't tell me why that's wrong. Because it isn't wrong. It's absolutely right. The same zoom level and cropping. MASSIVELY larger focus zone.

If we doubled both dimensions of the sensor, thus doubling the CoC, it would halve the HF. If we instead doubled the focal length it QUADRUPLES the HF. The focal length is a squared factor and outweighs any other component. For a reason.

If you double the focal length you also have to double the sensor dimensions (to get the same angle of view) and hence double the size of the CoC - so you end up with f^2/f = f. That is, you double the numerator in the DoF formula because the CoC has doubled, and quadruple the denominator because the focal length has doubled, with the end result that the DoF halves.

Your mistake is one that’s easy to make and one that I’ve made myself before. We’re not trolling you. You’re just losing track of a factor of f and thereby getting the wrong result.

By the way, I also agree with your overall point about smaller sensor cameras being better suited to macro photography. It’s just that your f512 claim is based on a mistaken calculation.

You can't use the same aperture. The SLR has to be at a smaller aperture so the diameter of the lens is the same. That way both will gather the same amount of light and have the same amount of bokeh.

That's your issue - you need to use equivalent apertures.

The CoC refers to the circle in the pixel that a point will be focused to. The pixels on an iPhone are much smaller than the pixels on a camera. If you use the same CoC for the iPhone, you are referring to many more pixels than on a DSLR.

Therefore, when you use the same CoC, you are asking the DSLR to be dozens of times closer to perfect focus, in pixel terms, than the iPhone, which is why you are calculating outlandish f stop values.

If instead, you have a target that the object must resolve to a pixel with the same resolution on both, you will arrive to an f stop linearly proportional to the sensor size, instead of proportional to the square of the sensor size.

I clearly used completely different CoCs, factoring in the different sensor sizes.

At this point I feel like you are just posting things hoping some future visitor will think that your commitment must demonstrate that you are right. I guess.

You clearly did not. If you scaled the CoC exactly with the crop factor, we would find exactly the same numbers.