1

I've been working with an industrial Dahua camera and since I do not have a full model of how the camera works (and because I'm a complete newbie to cameras in general), a few elements are still puzzling me. My goal is to find what the focal plane distance is (in meters).

So first of all, this is the camera and here are the adjustable parameters:

Adjustable parameters

According to the definitions provided by the software:

Zoom: If you press the plus/minus key, the focal length of the video increses/decreases.

Focus: If you press the plus/minus key, the focal plane of the lens moves to the long/close shot.

The ranges are [0, 852] for zoom and [0, 1025] for focus. When I change the zoom, the camera changes its focus automatically for optimal sharpness, so considering the above definitions, I assumed it can't be that hard to find the focal plane's distance. I've no idea what the units are despite having read a bunch of posts on camera zoom and focus, so a little help would be greatly appreciated.

Mat
  • 113
  • 4
  • Can you elaborate more on "When I change the zoom, the camera changes its focus automatically for optimal sharpness, so considering the above definitions, I assumed it can't be that hard to find the focal plane's distance."? I don't see how the two (three) statements are really connected. – mattdm Jun 10 '19 at 15:53
  • @mattdm Basically when I move the Zoom slider, the software moves the Focus slider to keep the image sharp. I thought that if the software does autofocus it'd be possible to know how far the focal plane is, but if that's nonsense please forgive me ! – Mat Jun 10 '19 at 15:56
  • Ah, I see. Are you sure that the number is changing for optimal sharpness (the specs don't mention autofocus or anything) and not just changing (basically arbitrarily) as a consequence of having changed the zoom? – mattdm Jun 10 '19 at 16:01
  • Well what you say seems possible, although when I read the camera's code, they have used functions such as autoFocus, adjustFocus and adjustFocusContinuously. Also see the image I posted; the AutoFocus button will always move the Focus slider back to a unique value (which I believe is the sharpest). – Mat Jun 10 '19 at 16:06
  • Ah, so... the auto-focus is probably done in the software by looking for maximum contrast. (As opposed to the same thing happening in the camera's firmware when issued a command.) In that case, it's most likely that the software is simply calling that operation after zooming. – mattdm Jun 10 '19 at 16:11
  • (The "regional focus" button probably brings up a way to select an area in which contrast is to be maximized, rather than the default of entire frame or some center point.) – mattdm Jun 10 '19 at 16:12
  • So with that knowledge, is it not possible at all to determine the focus distance in meters (other than the minimum/close focus) ? – Mat Jun 10 '19 at 16:12
  • Probably not, no. Sorry. – mattdm Jun 10 '19 at 16:18
  • 1
    Cameras meant for photography (or video) aren't necessarily great at being measuring devices. You'll probably be better off with a device meant for the purpose. – mattdm Jun 10 '19 at 16:21
  • 5
    I'm voting to close this question as off-topic because this is about using an industrial camera to measure distance, not about photography. – mattdm Jun 10 '19 at 16:21
  • Ok thanks, that's fair ! – Mat Jun 10 '19 at 16:30
  • 1
    Hi Mat, Welcome to Photography.StackExchange. We hope you enjoy sharing knowledge and experience. Since it's a scale slider implemented with software for industrial use, I tend to favour that it's an arbitrary scale chosen by the hardware programmer for software convenience rather than adhere to any standard a photographer might recognize. This happens when a programmer works outside of professional conventions for terminology or practices – Stan Jun 10 '19 at 17:41
  • @Stan Agreed. I suspect that this even extends to the term "varifocal" in the description. I bet that's not used in the technical sense of that term in photography today but just used as a fancy way of saying "it's a zoom lens", or maybe even "focus is adjustable". – mattdm Jun 20 '19 at 16:03

1 Answers1

2

From the specs, the lens's zoom is from 4.1mm (wide) to 16.4mm (zoomed in). Focal length is the only standard measurement of this, and that's almost universally in millimeters. (You can find it specified in inches if you go back to 19th century lenses.) The range 0–852 clearly doesn't correspond directly to focal length; it is probably stepper motor steps or something similar that is specific to this particular camera. There's not even any promise that this is linear.

Focus distance, unfortunately, seems to be a similar situation. The close focus distance is 0.5m and the far focus distance is unspecified but is probably past infinity. And the complication is probably compounded because it's extremely likely that this distance changes as you zoom. (That is, it's extremely unlikely that the lens is parfocal.) This means that it's probable that a single number for "focus" can mean a different focus distance depending on the zoom setting.

All that said, if you have a specific fixed setup, you can probably just measure and see what the correspondence is. It's possible that you can derive a formula which fits well enough for your application — or you can even just have a look-up table for each value. (Although note that the same value may not always be exactly the same position — that kind of precision might not be in the design of the camera.)

mattdm
  • 143,140
  • 52
  • 417
  • 741