#include <SENSVideoStream.h>
Definition at line 8 of file SENSVideoStream.h.
◆ SENSVideoStream()
| SENSVideoStream::SENSVideoStream |
( |
const std::string & |
videoFileName, |
|
|
bool |
videoLoops, |
|
|
bool |
mirrorH, |
|
|
bool |
mirrorV, |
|
|
float |
targetFps = 0 |
|
) |
| |
Definition at line 8 of file SENSVideoStream.cpp.
22 _cap.open(videoFileName);
28 _fps = (float)
_cap.get(cv::CAP_PROP_FPS);
cv::Size2i _videoFrameSize
std::string _videoFileName
bool fileExists(const string &pathfilename)
Returns true if a file exists.
◆ calibration()
Definition at line 26 of file SENSVideoStream.h.
std::unique_ptr< SENSCalibration > _calibration
◆ fps()
| float SENSVideoStream::fps |
( |
| ) |
const |
|
inline |
◆ frameCount()
| int SENSVideoStream::frameCount |
( |
| ) |
const |
|
inline |
◆ getFrameSize()
| cv::Size SENSVideoStream::getFrameSize |
( |
| ) |
const |
|
inline |
◆ grabNextFrame()
Definition at line 38 of file SENSVideoStream.cpp.
46 _cap.set(cv::CAP_PROP_POS_FRAMES, 0);
53 if (
_cap.read(bgrImg))
56 cv::cvtColor(bgrImg, grayImg, cv::COLOR_BGR2GRAY);
58 sensFrame = std::make_unique<SENSFrame>(
std::shared_ptr< SENSFrame > SENSFramePtr
void mirrorImage(cv::Mat &img, bool mirrorH, bool mirrorV)
◆ grabNextResampledFrame()
Definition at line 73 of file SENSVideoStream.cpp.
81 _cap.set(cv::CAP_PROP_POS_FRAMES, 0);
89 int frameIndex = (int)
_cap.get(cv::CAP_PROP_POS_FRAMES);
92 float lastFrameTime = frameIndex /
_fps;
96 frameTime = (float)(frameIndex + skippedFrame) /
_fps;
97 }
while ((frameTime - lastFrameTime) < frameDuration);
99 float frameError = (frameTime - lastFrameTime - frameDuration);
101 float totalError = (nbFrame * frameError);
102 if ((fmod(totalError, frameDuration) + frameError) > frameDuration && skippedFrame > 1)
109 if (
_cap.read(bgrImg))
112 cv::cvtColor(bgrImg, grayImg, cv::COLOR_BGR2GRAY);
114 sensFrame = std::make_unique<SENSFrame>(
void moveCapturePosition(int n)
◆ grabPreviousFrame()
◆ grabPreviousResampledFrame()
| SENSFramePtr SENSVideoStream::grabPreviousResampledFrame |
( |
| ) |
|
Definition at line 129 of file SENSVideoStream.cpp.
131 int frameIndex = (int)
_cap.get(cv::CAP_PROP_POS_FRAMES);
132 int skippedFrame = 0;
134 float currentFrameTime = frameIndex /
_fps;
138 frameTime = frameIndex - skippedFrame /
_fps;
140 }
while ((currentFrameTime - frameTime) > 1.0 /
_targetFps);
◆ guessAndSetCalibration()
| void SENSVideoStream::guessAndSetCalibration |
( |
float |
fovGuess | ) |
|
Definition at line 176 of file SENSVideoStream.cpp.
Class for holding computer information.
std::vector< char > & get(std::string path)
◆ isOpened()
| bool SENSVideoStream::isOpened |
( |
| ) |
const |
|
inline |
◆ moveCapturePosition()
| void SENSVideoStream::moveCapturePosition |
( |
int |
n | ) |
|
|
private |
Definition at line 152 of file SENSVideoStream.cpp.
154 int frameIndex = (int)
_cap.get(cv::CAP_PROP_POS_FRAMES);
162 _cap.set(cv::CAP_PROP_POS_FRAMES, frameIndex);
◆ nextFrameIndex()
| int SENSVideoStream::nextFrameIndex |
( |
| ) |
const |
|
inline |
◆ setCalibration()
| void SENSVideoStream::setCalibration |
( |
SENSCalibration |
calibration, |
|
|
bool |
buildUndistortionMaps |
|
) |
| |
Definition at line 165 of file SENSVideoStream.cpp.
167 if (!
_cap.isOpened())
cv::Size imageSize() const
const SENSCalibration *const calibration() const
◆ videoFilename()
| const std::string& SENSVideoStream::videoFilename |
( |
| ) |
const |
|
inline |
◆ _calibration
◆ _cap
| cv::VideoCapture SENSVideoStream::_cap |
|
private |
◆ _fps
| float SENSVideoStream::_fps = 0.f |
|
private |
◆ _frameCount
| int SENSVideoStream::_frameCount = 0 |
|
private |
◆ _mirrorH
| bool SENSVideoStream::_mirrorH = false |
|
private |
◆ _mirrorV
| bool SENSVideoStream::_mirrorV = false |
|
private |
◆ _targetFps
| float SENSVideoStream::_targetFps |
|
private |
◆ _videoFileName
| std::string SENSVideoStream::_videoFileName |
|
private |
◆ _videoFrameSize
| cv::Size2i SENSVideoStream::_videoFrameSize |
|
private |
◆ _videoLoops
| bool SENSVideoStream::_videoLoops = false |
|
private |
The documentation for this class was generated from the following files: