Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A cross platform video capture library with a focus on machine vision.

License

NotificationsYou must be signed in to change notification settings

trcwm/openpnp-capture

 
 

Repository files navigation

OpenPNP Logo

openpnp-capture

OpenPnP Capture is a cross platform video capture library for C with a focus on machine vision. Its goals are:

  • Native camera access on Windows, Linux and Mac. Implemented with DirectShow, V4L2 and AVFoundation respectively.
  • Named device enumeration.
  • Strong, repeatable, unique IDs.
  • Format control with support for at least YUV and MJPEG. Compressed formats such as MJPEG allow the use of multiple USB cameras on a hub or root controller.
  • Auto and manual exposure control.
  • Auto and manual focus control.
  • Simple, common C wrapper for the listed APIs.

Features

FeatureWindowsmacOSLinux
Platform APIDirectShowAVFoundationV4L2
Named Device EnumerationYesYesYes
CapturingYesYesYes
MJPEG formatsYesYes (dmb1)Yes
YUV formatsYesYesYes, YUYV/YUV2
Exposure controlYesYesYes
Focus controlYesYesYes
Zoom controlYesYesYes
Gain controlYesYesYes
White balance controlYesYesYes
Common C APIYesYesYes
Framerate controlNoNoNo
Re-EnumerationNoNoNo

Getting Started

Packages and binaries are available inreleases.

Examples:

  • QtCaptureTest is a cross platform test program for OpenPnP implemented with Qt.
  • openpnp-capture includes simple examples forMac,Linux, andWindows.

See below for information about Building OpenPnP Capture.

Documentation for openpnp-capture needs improvement. We would love yourhelp!

Building OpenPnP Capture

Dependencies

  • CMAKE 3.1 or better
  • MAKE (osx, linux)
  • Visual Studio 2013 + NMake or Ninja Build (windows)
  • NASM for building libjpeg-turbo (linux)
  • libgtk-3-dev (linux, test program)

Build instructions (Windows)

Run the batch file 'bootstrap.bat' and choose the desired build system (VisualStudio/nmake or Ninja). Make sure the compiler (Visual Studio) is in the search path.

Go to the build directory and run nmake or ninja to build the library and the test application.

Build instructions (OSX)

Run 'bootstrap_osx.sh'. Run make.

Build instructions (Linux)

Run 'bootstrap_linux.sh'. Run make.

Supporting Other Platforms

  • Implement all PlatformXXX classes, like in the win or linux directories.
  • PlatformContext handles device and internal frame buffer format enumeration.
  • PlatformStream is responsible for capturing and decoding the camera stream to a 8-bit per channel RGB frame buffer.
  • Statically link external dependencies.

Releases

Releases are built automatically for new tags on all supported platforms usingGithub Actions. Seehttps://github.com/openpnp/openpnp-capture/releases/latest to download the latest.

Platform Notes

MacOS

On MacOS as of 10.15 Camera permission is needed to open the camera. The library will automaticallyexecute the permission request, but an Info.plist is required to exist in the application bundle.An example Info.plist is:

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>NSCameraUsageDescription</key><string>openpnp-capture needs permission to access the camera to capture images.</string></dict></plist>

You can reset the camera permissions in MacOS for testing purposes by running tccutil reset Camera.

About

A cross platform video capture library with a focus on machine vision.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C43.1%
  • Assembly29.8%
  • HTML13.3%
  • C++4.1%
  • Java3.9%
  • CMake2.0%
  • Other3.8%

[8]ページ先頭

©2009-2025 Movatter.jp