PARP Research Group | Universidad de Murcia |
QVVideoReaderBlock Class Reference
|
Signals | |
void | opened () |
Emitted each time a new video source is opened. | |
void | closed () |
Emitted each time the video source is closed. | |
void | grabbed () |
Emitted each time a new frame is grabbed. | |
Public Member Functions | |
QVVideoReaderBlock (QString name=QString("")) | |
Constructor for QVVideoReaderBlock class. | |
~QVVideoReaderBlock () | |
Destructor for QVVideoReaderBlock class. | |
bool | linkProperty (QVPropertyContainer *dstCont, QString dstProp) |
Links a QVImage<uChar,3> (RGB image) or QVImage<uChar,1> (gray image) from the camera to another block. | |
bool | linkProperty (QVPropertyContainer *dstCont, QString dstProp1, QString dstProp2, QString dstProp3, bool YUV_RGB=false) |
Links 3 QVImage<uChar,1> from the camera (YUV channels) to the corresponding ones of another block. |
This is a generic video input processing block for the QVision architecture.
This is a generic video input processing block (see QVProcessingBlock) for the QVision architecture, which is based on the corresponding generic video source reader class QVVideoReader. You will find it very useful when writing QVision programs which have to process a sequence of video images, as it provides you with a lot of functionality by default, such as selecting from a wide range of video sources in runtime, rescaling input images, grab YUV, gray or RGB images, pausing the video, or going directly to a desired position in it, among many other possibilities. Compile and test example videoReader.cpp in Example programs section for a quick hands-on introduction to its usage.
As any other QVProcessingBlock, it has some custom input and output properties:
The user can set desired values for these properties directly through the command line, and the programmer through the corresponding QVProcessingBlock::setPropertyValue method:
Note.- RealTime property is also input (and as such can be initialized using the command line), but invisible to the GUI (because once the source has been linked, it cannot be relinked changing its synchronism).
Note.- Note also that you can open the camera in a different size of that specified in the real video source, by setting the desired values of properties Cols and Rows (this class will automatically rescale output images if needed).
These can be accessed using the corresponding QVProcessingBlock::getPropertyValue method:
Note.- Remember again that you can open the camera in a different size of that specified in the real video source file (this class will automatically rescale output images if needed); thus, ColsR and RowsR will always contain the real size of the output images served by this block.
Again, these can be accessed using the QVProcessingBlock::getPropertyValue method:
./program --URL="/home/me/myfile.avi --Rows=300 --Cols=400"
. But modification of these properties can also be done directly in the corresponding graphical widgets when reopening the camera during execution (though, of course, these new values will have no effect until the camera is reopened).Definition at line 115 of file qvvideoreaderblock.h.
QVVideoReaderBlock::QVVideoReaderBlock | ( | QString | name = QString("") |
) |
Constructor for QVVideoReaderBlock class.
name | the (optional) name given to the camera block. |
Definition at line 40 of file qvvideoreaderblock.cpp.
QVVideoReaderBlock::~QVVideoReaderBlock | ( | ) |
Destructor for QVVideoReaderBlock class.
Definition at line 98 of file qvvideoreaderblock.cpp.
bool QVVideoReaderBlock::linkProperty | ( | QVPropertyContainer * | dstCont, | |
QString | dstProp | |||
) |
Links a QVImage<uChar,3> (RGB image) or QVImage<uChar,1> (gray image) from the camera to another block.
This method will automatically link, using the adequate synchronism (Asynchronous for real time cameras and Synchronous for non real time cameras; see QVPropertyContainer), a gray or an RGB image in the block to the corresponding output image property of the camera. An error (return value=false) will occur if dstProp is not of the adequate type (QVImage<uChar,3> or QVImage<uChar,1>).
dstCont | Pointer to the destination block. | |
dstProp | Name of the destination property. |
Definition at line 223 of file qvvideoreaderblock.cpp.
bool QVVideoReaderBlock::linkProperty | ( | QVPropertyContainer * | dstCont, | |
QString | dstProp1, | |||
QString | dstProp2, | |||
QString | dstProp3, | |||
bool | YUV_RGB = false | |||
) |
Links 3 QVImage<uChar,1> from the camera (YUV channels) to the corresponding ones of another block.
This method will automatically link, using the adequate synchronism (Asynchronous for real time cameras and Synchronous for non real time cameras; see QVPropertyContainer), a set of three one channel images in the block to the corresponding output image properties of the camera. An error (return value=false) will occur if any of the dstProp are not of the adequate QVImage<uChar,1> type.
dstCont | Pointer to the destination block. | |
dstProp1 | Name of the destination property for image Y (or R; see YUV_RGB parameter). | |
dstProp2 | Name of the destination property for image U (or G; see YUV_RGB parameter). | |
dstProp3 | Name of the destination property for image V (or B; see YUV_RGB parameter). | |
YUV_RGB | if false (default), Y, U and V images are linked; otherwise, R, G, and B will be linked. |
Definition at line 240 of file qvvideoreaderblock.cpp.
void QVVideoReaderBlock::opened | ( | ) | [signal] |
Emitted each time a new video source is opened.
void QVVideoReaderBlock::closed | ( | ) | [signal] |
Emitted each time the video source is closed.
void QVVideoReaderBlock::grabbed | ( | ) | [signal] |
Emitted each time a new frame is grabbed.