Image Component Library (ICL)
|
Common interface class for all grabbers. More...
#include <GenericGrabber.h>
Public Member Functions | |
GenericGrabber (const utils::ProgArg &pa) | |
Initialized the grabber from given prog-arg. More... | |
GenericGrabber (const std::string &devicePriorityList, const std::string ¶ms, bool notifyErrors=true) | |
Create a generic grabber instance with given device priority list. More... | |
GenericGrabber () | |
Empty default constructor, which creates a null-instance. More... | |
void | init (const std::string &devicePriorityList, const std::string ¶ms, bool notifyErrors=true) |
initialization function to change/initialize the grabber back-end More... | |
void | init (const utils::ProgArg &pa) |
this method works just like the other init method More... | |
std::string | getType () const |
return the actual grabber type More... | |
Grabber * | getGrabber () const |
returns the wrapped grabber itself More... | |
virtual | ~GenericGrabber () |
Destructor. More... | |
const core::ImgBase * | grab (core::ImgBase **dst=0) |
grab function calls the Grabber-specific acquireImage-method and applies distortion if necessary More... | |
bool | isNull () const |
returns wheter an underlying grabber could be created More... | |
operator bool () const | |
simpler interface for isNull() (returns !isNull() More... | |
void | setDesiredFormatInternal (core::format fmt) |
internally set a desired format More... | |
void | setDesiredSizeInternal (const utils::Size &size) |
internally set a desired format More... | |
void | setDesiredDepthInternal (core::depth d) |
internally set a desired format More... | |
core::format | getDesiredFormatInternal () const |
returns the desired format More... | |
core::depth | getDesiredDepthInternal () const |
returns the desired format More... | |
utils::Size | getDesiredSizeInternal () const |
returns the desired format More... | |
void | registerCallback (Grabber::callback cb) |
passes registered callback to the internal pointer More... | |
void | removeAllCallbacks () |
passes registered callback to the internal pointer More... | |
template<class T > | |
bool | desiredUsed () const |
returns whether the desired parameter for the given type is used More... | |
template<class T > | |
void | useDesired (const T &t) |
sets desired parameters (only available for core::depth,utils::Size and core::format) More... | |
void | useDesired (core::depth d, const utils::Size &size, core::format fmt) |
sets up the grabber to use all given desired parameters More... | |
template<class T > | |
void | ignoreDesired () |
set the grabber to ignore the desired param of type T More... | |
void | ignoreDesired () |
sets up the grabber to ignore all desired parameters More... | |
template<class T > | |
T | getDesired () const |
returns the desired value for the given type T More... | |
void | enableUndistortion (const std::string &filename) |
enables the undistorion More... | |
void | enableUndistortion (const ImageUndistortion &udist) |
enables the undistortion plugin for the grabber using radial and tangential distortion parameters More... | |
void | enableUndistortion (const utils::ProgArg &pa) |
enables undistortion from given programm argument. More... | |
void | enableUndistortion (const core::Img32f &warpMap) |
enables undistortion for given warp map More... | |
void | setUndistortionInterpolationMode (core::scalemode mode) |
sets how undistortion is interpolated (supported modes are interpolateNN and interpolateLIN) More... | |
void | disableUndistortion () |
disables distortion More... | |
bool | isUndistortionEnabled () const |
returns whether distortion is currently enabled More... | |
const core::Img32f * | getUndistortionWarpMap () const |
returns the internal warp map or NULL if undistortion is not enabled More... | |
void | init (const GrabberDeviceDescription &dev) |
initializes the grabber from given FoundDevice instance More... | |
Public Member Functions inherited from icl::utils::ConfigurableProxy | |
virtual | ~ConfigurableProxy () |
virtual destructor More... | |
ConfigurableProxy (Configurable *c=NULL) | |
Constructor with passed internal Configurable. More... | |
void | setInternalConfigurable (Configurable *c=NULL) |
sets the internally used Configurable to the passed one More... | |
Configurable * | getInternalConfigurable () const |
returns the internally used Configurable More... | |
void | setPropertyValue (const std::string &propertyName, const Any &value) |
sets a property value More... | |
std::vector< std::string > | getPropertyList () const |
returns a list of All properties, that can be set using setProperty More... | |
bool | supportsProperty (const std::string &propertyName) const |
base implementation for property check (seaches in the property list) More... | |
void | saveProperties (const std::string &filename, const std::vector< std::string > &propertiesToSkip=Configurable::EMPTY_VEC) const |
writes all available properties into a file More... | |
void | loadProperties (const std::string &filename, const std::vector< std::string > &propertiesToSkip=Configurable::EMPTY_VEC) |
reads a camera config file from disc More... | |
void | addChildConfigurable (Configurable *configurable, const std::string &childPrefix="") |
void | registerCallback (Configurable::Callback cb) |
std::string | getPropertyType (const std::string &propertyName) const |
get type of property More... | |
std::string | getPropertyInfo (const std::string &propertyName) const |
get information of a properties valid values More... | |
Any | getPropertyValue (const std::string &propertyName) const |
returns the current value of a property or a parameter More... | |
std::string | getPropertyToolTip (const std::string &propertyName) const |
returns the tooltip description for a given property More... | |
int | getPropertyVolatileness (const std::string &propertyName) const |
Returns whether this property may be changed internally. More... | |
void | syncChangesTo (Configurable *configurables, int num=1) |
syncronzies all property changes to the given configurable More... | |
void | syncChangesTo (ConfigurableProxy *configurable) |
syncronzies all property changes to the given configurable More... | |
Static Public Member Functions | |
static void | resetBus (const std::string &deviceList="dc", bool verbose=false) |
resets resource on given devices (e.g. firewire bus) More... | |
static const std::vector< GrabberDeviceDescription > & | getDeviceList (const std::string &filter, bool rescan=true) |
returns a list of all currently available devices (according to the filter-string) More... | |
Private Attributes | |
Grabber * | m_poGrabber |
internally wrapped grabber instance More... | |
GrabberDeviceDescription | m_poDesc |
description of current Grabber More... | |
utils::Mutex | m_mutex |
ConfigurableRemoteServer * | m_remoteServer |
<< internal protection for re-initialization More... | |
Additional Inherited Members | |
Protected Member Functions inherited from icl::utils::Uncopyable | |
Uncopyable () | |
Empty base constructor. More... | |
Common interface class for all grabbers.
The generic grabber provides an interface for a multi-platform compatible grabber. Image processing applications should use this Grabber class. The GenericGrabber also provides camera configuration via ConfigurableProxy interface.
|
inline |
Initialized the grabber from given prog-arg.
The progarg needs two sub-parameters
|
inline |
Create a generic grabber instance with given device priority list.
internally this function calls the init function immediately
|
inline |
Empty default constructor, which creates a null-instance.
null instances of grabbers can be adapted using the init-function
|
virtual |
Destructor.
|
inline |
returns whether the desired parameter for the given type is used
This method is only available for the type core::depth,icl::utils::Size and core::format
|
inline |
disables distortion
|
inline |
enables the undistorion
|
inline |
enables the undistortion plugin for the grabber using radial and tangential distortion parameters
|
inline |
enables undistortion from given programm argument.
where first argument is the filename of the xml file and second is the size of picture
|
inline |
enables undistortion for given warp map
|
inline |
returns the desired value for the given type T
This method is only available for core::depth,utils::Size and core::format
|
inline |
returns the desired format
|
inline |
returns the desired format
|
inline |
returns the desired format
|
static |
returns a list of all currently available devices (according to the filter-string)
The filter-string is a comma separated list of single filters like
dc=0,unicap
If a single token has the core::format deviceType=deviceID, then only not only the device type but also a specific ID is used for the filtering operation. If, otherwise, a token has the core::format deviceType, then all possible devices for this device type are listed.
|
inline |
returns the wrapped grabber itself
|
inline |
return the actual grabber type
|
inline |
returns the internal warp map or NULL if undistortion is not enabled
|
inline |
grab function calls the Grabber-specific acquireImage-method and applies distortion if necessary
If dst is not NULL, it is exploited and filled with image data
|
inline |
set the grabber to ignore the desired param of type T
This method is only available for core::depth,utils::Size and core::format
|
inline |
sets up the grabber to ignore all desired parameters
void icl::io::GenericGrabber::init | ( | const std::string & | devicePriorityList, |
const std::string & | params, | ||
bool | notifyErrors = true |
||
) |
initialization function to change/initialize the grabber back-end
devicePriorityList | Comma separated list of device tokens (no white spaces). something like "dc,pwc,file,unicap" with arbitrary order undesired devices can be left out. In particular you can also give only a single desired device type e.g. "pwc". The following device types are supported:
|
params | comma separated device depend parameter list: e.g. "v4l=0,file=images//image*.ppm,dc=0" with self-explaining syntax Additionally, each token a=b can be extended by device property that are directly set after device instantiation. E.g. demo=0@size=QVGA@blob-red=128, instantiates a demo-grabber, where the two additionally given properties (size and blob-red) are set immediately after grabber instantiation. By these means particularly a grabber's core::format can be set in the grabber instantiation call. Furthermore, three special @-tokens are possible: @info (e.g. dc=0@info) lists the 0th dc device's available properties. @load=filename loads a given property filename directly. @udist=filename loads a given undistortion parameter filename directly and therefore makes the grabber grab undistorted images according to the undistortion parameters and model type (either 3 or 5 parameters) that is found in the given xml-file. todo fix this sentence according to the fixed application names Please note, that valid xml-undistortion files can be created using the undistortion-calibration tools icl-opencvcamcalib-demo, icl-intrinsic-camera-calibration and icl-intrinsic-calibrator-demo. On the C++-level, this is only a minor advantage, since all these things can also be achieved via function calls, however if you use the most recommended way for ICL-Grabber instantiation using ICL's program-argument evaluation framework, The GenericGrabber is instantiated using grabber.init(pa("-i")) which then allows the application user to set grabber parameters via addiation @-options on the command line: e.g.: "icl-camviewer -input dc 0\@size=VGA" |
Semantics:
notifyErrors | if set to false, no exception is thrown if no suitable device was found |
void icl::io::GenericGrabber::init | ( | const utils::ProgArg & | pa | ) |
this method works just like the other init method
|
inline |
initializes the grabber from given FoundDevice instance
calls 'init(dev.type,dev.type+"="+dev.id,false)'
|
inline |
returns wheter an underlying grabber could be created
|
inline |
returns whether distortion is currently enabled
|
inline |
simpler interface for isNull() (returns !isNull()
|
inline |
passes registered callback to the internal pointer
|
inline |
passes registered callback to the internal pointer
|
static |
resets resource on given devices (e.g. firewire bus)
|
inline |
internally set a desired format
|
inline |
internally set a desired format
|
inline |
internally set a desired format
|
inline |
sets how undistortion is interpolated (supported modes are interpolateNN and interpolateLIN)
Please note, that this method has no effect if the undistortion was not enabled before using one of the Grabber::enableUndistortion methods. Furthermore, the setting is lost if the undistortion is deactivated using Grabber::disableUndistortion
|
inline |
sets desired parameters (only available for core::depth,utils::Size and core::format)
|
inline |
sets up the grabber to use all given desired parameters
|
mutableprivate |
|
private |
description of current Grabber
|
private |
internally wrapped grabber instance
|
private |
<< internal protection for re-initialization