Adding mirror image support.
This commit is contained in:
parent
90ccbcb72a
commit
eb5a2ed01f
2 changed files with 11 additions and 5 deletions
|
@ -384,22 +384,23 @@ namespace HeadPoseLive
|
||||||
// CAPTURE FRAME AND DETECT LANDMARKS FOLLOWED BY THE REQUIRED IMAGE PROCESSING
|
// CAPTURE FRAME AND DETECT LANDMARKS FOLLOWED BY THE REQUIRED IMAGE PROCESSING
|
||||||
//////////////////////////////////////////////
|
//////////////////////////////////////////////
|
||||||
|
|
||||||
RawImage frame = null;
|
RawImage frame = reader.GetNextImage();
|
||||||
frame = reader.GetNextImage();
|
|
||||||
|
|
||||||
lastFrameTime = CurrentTime;
|
lastFrameTime = CurrentTime;
|
||||||
processing_fps.AddFrame();
|
processing_fps.AddFrame();
|
||||||
|
|
||||||
var grayFrame = reader.GetCurrentFrameGray();
|
var grayFrame = reader.GetCurrentFrameGray();
|
||||||
|
|
||||||
if (grayFrame == null)
|
if (mirror_image)
|
||||||
continue;
|
{
|
||||||
|
frame.Mirror();
|
||||||
|
grayFrame.Mirror();
|
||||||
|
}
|
||||||
|
|
||||||
bool detectionSucceeding = ProcessFrame(face_model, gaze_analyser, model_params, frame, grayFrame, reader.GetFx(), reader.GetFy(), reader.GetCx(), reader.GetCy());
|
bool detectionSucceeding = ProcessFrame(face_model, gaze_analyser, model_params, frame, grayFrame, reader.GetFx(), reader.GetFy(), reader.GetCx(), reader.GetCy());
|
||||||
|
|
||||||
lock (recording_lock)
|
lock (recording_lock)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (recording)
|
if (recording)
|
||||||
{
|
{
|
||||||
// Add objects to recording queues
|
// Add objects to recording queues
|
||||||
|
|
|
@ -136,6 +136,11 @@ namespace OpenCVWrappers {
|
||||||
refCount++;
|
refCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Mirror()
|
||||||
|
{
|
||||||
|
cv::flip(*mat, *mat, 1);
|
||||||
|
}
|
||||||
|
|
||||||
// Finalizer. Definitely called before Garbage Collection,
|
// Finalizer. Definitely called before Garbage Collection,
|
||||||
// but not automatically called on explicit Dispose().
|
// but not automatically called on explicit Dispose().
|
||||||
// May be called multiple times.
|
// May be called multiple times.
|
||||||
|
|
Loading…
Reference in a new issue