Display a video frame with OpenCV, to be used on the desktop - VideoFormat::MJPEG (the default) expects one complete, already-encoded JPEG image assembled across write() calls and closed off by flush(), as produced by e.g. DemuxerAVI. Any other setVideoFormat() value (e.g. RGB565, the common raw picture format decoders like H264Decoder produce) expects one complete, already-decoded picture per write() call instead - setSize() must be called too in that case, since unlike JPEG a raw picture doesn't carry its own dimensions.
More...
#include <OutputOpenCV.h>
Display a video frame with OpenCV, to be used on the desktop - VideoFormat::MJPEG (the default) expects one complete, already-encoded JPEG image assembled across write() calls and closed off by flush(), as produced by e.g. DemuxerAVI. Any other setVideoFormat() value (e.g. RGB565, the common raw picture format decoders like H264Decoder produce) expects one complete, already-decoded picture per write() call instead - setSize() must be called too in that case, since unlike JPEG a raw picture doesn't carry its own dimensions.
- Author
- Phil Schatzmann
- Copyright
- GPLv3
◆ OutputOpenCV()
◆ displayJpeg()
◆ displayRaw()
| void displayRaw |
( |
const uint8_t * |
data, |
|
|
size_t |
len |
|
) |
| |
|
inlineprotected |
Wraps one complete, already-decoded raw picture (no copy - OpenCV reads directly out of 'data') and converts it to OpenCV's native BGR for display. Not every VideoFormat OpenCV could conceivably display is covered here - see the switch below for exactly which ones are.
◆ ensureWindow()
◆ flush()
Displays the assembled jpeg image, then resets for the next frame - only relevant for VideoFormat::MJPEG; raw formats display immediately from write() instead (one complete picture per call), so this is a no-op for those.
Reimplemented from VideoOutput.
◆ setSize()
| void setSize |
( |
uint16_t |
width, |
|
|
uint16_t |
height |
|
) |
| |
|
inline |
Defines the picture size - only needed (and used) for raw, non-MJPEG formats (see class comment). Call before the first write().
◆ setVideoFormat()
Selects the format of the data passed to write() - see class comment.
◆ write()
| size_t write |
( |
const uint8_t * |
data, |
|
|
size_t |
len |
|
) |
| |
|
inlineoverridevirtual |
◆ create_window
| bool create_window = true |
|
protected |
◆ height
◆ img_vector
| std::vector<uint8_t> img_vector |
|
protected |
◆ pos
◆ start
◆ video_format
◆ width
◆ window
| const char* window = "Movie" |
|
protected |
The documentation for this class was generated from the following file: