Skip to content

OpenPnpCaptureCamera

Hellsparrow edited this page Feb 23, 2023 · 13 revisions

OpenPnpCaptureCamera는 Niels Moseley의 openpnp-capture 라이브러리를 기반으로 하는 OpenPnP 카메라 드라이버입니다. 사용 가능한 가장 진보된 OpenPnP 카메라 드라이버로, 단일 호스트에서 여러 USB 카메라를 사용할 수 있으며 노출, 밝기, 초점 등과 같은 구성 매개변수를 지정할 수 있습니다.

다중 카메라

동일한 USB 호스트에서 여러 USB 카메라를 사용하는 경우 고려해야 할 몇 가지 제한 사항이 있습니다. 우선 OpenPnP에서 형식을 선택할 때 압축 포맷을 사용하는 것이 중요합니다. 압축 포맷에는 여러 이름이 있습니다. 가장 일반적인 것은 1bmd, dmb1, mjpg 및 mjpeg입니다. yuv, vuy, yuv2 등과 같은 압축되지 않은 포맷은 동일한 호스트에서 여러 대의 카메라를 사용할 때 사용할 수 없습니다.

여러 USB 카메라의 제한 사항에 대한 자세한 내용은 USB 카메라 문제 해결 FAQ를 참조하세요.

카메라의 포맷을 구성하려면:

  1. Machine Setup -> Cameras or Machine Setup -> Heads -> Cameras로 이동하여 설정할 카메라를 선택합니다.
  2. 카메라별 탭을 선택합니다.
  3. 일반 섹션까지 아래로 스크롤하고 format 드롭다운을 클릭합니다. screen shot 2018-09-10 at 9 03 09 pm
  4. 포맷 목록에서 해상도와 FPS 요구 사항을 충족하는 압축 포맷을 찾습니다. 드롭다운에 압축된 포맷이 없으면 다른 카메라로 변경해야 합니다(무엇을 빌드해야 하나요 참조를 권장) 또는 각 카메라를 자체 USB 호스트 포트에 배치합니다.

카메라 특성

카메라 제조사 및 모델에 따라 다양한 속성을 사용/활성화할 수 있습니다. 문제 및 솔루션 마법사는 올바른 속성을 설정하는 몇 가지 조언을 제안합니다.

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, 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 original real world information from the sensor, even if it looks not so crispy to you. Therefore, minimize Sharpness, set Contrast, Gamma etc. to their respective Default values indicated on the right side.

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.

If in doubt, set to the Default value indicated on the right side.

Camera Properties

Freezing Camera Properties

Freeze Properties

The Freeze Properties? switch determines how camera properties are handled:

  • If disabled (default), the camera device driver will store the properties (Auto and Value). They are queried from the camera whenever it is reopened.
  • If enabled (new), the OpenPnP configuration (machine.xml) will store all the currently set properties (Auto and Value). They are reapplied to the camera whenever it is later reopened. To make sure you get repeatable results, the properties will also be reapplied when the machine is homed. They can still be changed through the UI, but settings will never be overwritten with those queried from the camera device.

Enable Freeze Properties? when you want repeatable settings stored with the OpenPnP configuration. You can then switch between configurations or even between different applications using the web cam with no harm. The configured properties will always be restored.

Likewise if you mistakenly reconnect the two cameras to the wrong/swapped USB port, it will no longer overwrite or reset the configured settings. Just connect to the right USB ports or select the right USB device from the drop-down and press Apply. The configured settings will be restored to the camera (an OpenPnP restart might be needed for a fresh USB device enumeration).

Finally, if your camera device driver or OS does not properly store settings between OpenPnP sessions or OS reboots, they are now restored as soon OpenPnP reopens the camera.

Notes:

  • Some cameras have been reported to not accept properties correctly on the reopen. For this reason properties are also applied when homing the machine. Use the Reapply to Camera button (only available with frozen properties), to reapply properties to the camera any time. If frequent manual reapplication is necessary, i.e. if the camera is arbitrarily not accepting or losing its properties, please report to the discussion group.
  • If you first switch the Freeze Properties? on, press Apply for the properties to be initially frozen.
  • Once you want to change the camera device for a different make or model, you will likely need to disable Freeze Properties? and press Apply to query reasonable settings from the new camera (availability and ranges of properties may change between makes and models).

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