Skip to content

OpenPnpCaptureCamera

markmaker edited this page Aug 15, 2022 · 13 revisions

OpenPnpCaptureCamera is an OpenPnP camera driver based on the openpnp-capture library by Niels Moseley. It is the most advanced OpenPnP camera driver available, making it possible to use multiple USB cameras on a single host, and allowing you to specify configuration parameters such as exposure, brightness, focus, etc.

Multiple Cameras

When using multiple USB cameras on the same USB host, there are some limitations to consider. Primarily, it is important to use a compressed format when selecting the Format in OpenPnP. Compressed formats have a number of names. The most common are 1bmd, dmb1, mjpg, and mjpeg. Uncompressed formats such as yuv, vuy, yuv2, etc. cannot be used when using multiple cameras on the same host.

For more information on the limitations of multiple USB cameras, see the USB Camera Troubleshooting FAQ.

To configure the format for a camera:

  1. Go to Machine Setup -> Cameras or Machine Setup -> Heads -> Cameras and select the camera to configure.
  2. Select the Camera Specific tab.
  3. Scroll down to the General section and click the Format dropdown. screen shot 2018-09-10 at 9 03 09 pm
  4. In the list of Formats, find a compressed format that meets you resolution and FPS needs. If there are no compressed formats in the dropdown you will either need to change to a different camera (see What Should I Build for recommendations) or put each camera on it's own USB host port.

Camera Properties

Depending on the make and model of your camera, different properties will be available/enabled. Issues and Solutions will suggest some advice setting correct properties.

Generally, Auto settings should be avoided, as they lead to unstable conditions for computer vision. We need to be able to set stable thresholds, e.g. for brightness, color hue, saturation etc. which is not possible if they fluctuate between camera subjects. If your camera does not support switching off automatic exposure, consider replacing it. Seriously.

Unlike humans, computer vision does not care about the aesthetics of an image. Avoid all settings that aim at "pleasing" images. Disable/minimize sharpness, contrast enhancements, gamma etc. as these can be detrimental to the accuracy of computer vision. The raw, unmanipulated image at the right exposure is what we want, so computer vision gets the best quality real world information from the sensor, even if it looks not so crispy to you.

The optimal image is optimized for the brightest scene that is encountered in operation. In other scenes it might appear too dark to humans, however computer vision can still get enough information from even a fraction of the dynamic range, it is much more important that levels remain stable between scenes.

Camera Properties

Troubleshooting

Note that not all cameras behave as well as others. If you want to be sure of reliable operation of two cameras on a single USB host it is recommended that you use the ELP Model USB100W03M, 720p USB Cameras. See the Build FAQ for more camera recommendations.

Clone this wiki locally