Change copyright and format the code using clang-format
This commit is contained in:
1 parent
a69c32bfbf
commit
8a60bb2766
122 files changed
+12950
-12139
No files matched your search
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -24,22 +24,21 @@
|
||||
|
||||
#include "AbsoluteFrameDifference.h"
|
||||
|
||||
|
||||
AbsoluteFrameDifference::AbsoluteFrameDifference()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = MODULE_API_2; // Use API version 2 (recommended).
|
||||
// See this example for details on the functions prototype
|
||||
m_iModuleType = FRAME_PROCESSING_MODULE; // Apply module to the frames or to the whole sequence.
|
||||
m_pchModuleCategory = "Measurements"; // Category (sub-menu)
|
||||
m_pchModuleName = "AbsoluteFrameDifference"; // Name
|
||||
m_pchModuleTooltip = "Measure the absolute difference " // Description
|
||||
"between two images (Y plane), e. g., abs( Y1 - Y2 )";
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_TWO_FRAMES; // Number of Frames required (ONE_FRAME, TWO_FRAMES, THREE_FRAMES)
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_NEW_WINDOW; // Module requirements (check PlaYUVerModulesIf.h).
|
||||
// Several requirements should be "or" between each others.
|
||||
m_iModuleAPI = MODULE_API_2; // Use API version 2 (recommended).
|
||||
// See this example for details on the functions prototype
|
||||
m_iModuleType = FRAME_PROCESSING_MODULE; // Apply module to the frames or to the whole sequence.
|
||||
m_pchModuleCategory = "Measurements"; // Category (sub-menu)
|
||||
m_pchModuleName = "AbsoluteFrameDifference"; // Name
|
||||
m_pchModuleTooltip =
|
||||
"Measure the absolute difference " // Description
|
||||
"between two images (Y plane), e. g., abs( Y1 - Y2 )";
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_TWO_FRAMES; // Number of Frames required (ONE_FRAME, TWO_FRAMES, THREE_FRAMES)
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_NEW_WINDOW; // Module requirements (check PlaYUVerModulesIf.h).
|
||||
// Several requirements should be "or" between each others.
|
||||
m_pcFrameDifference = NULL;
|
||||
|
||||
}
|
||||
|
||||
Bool AbsoluteFrameDifference::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
@@ -47,10 +46,13 @@ Bool AbsoluteFrameDifference::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
_BASIC_MODULE_API_2_CHECK_
|
||||
|
||||
for( UInt i = 1; i < apcFrameList.size(); i++ )
|
||||
if( !apcFrameList[i]->haveSameFmt( apcFrameList[0], PlaYUVerFrame::MATCH_COLOR_SPACE | PlaYUVerFrame::MATCH_RESOLUTION | PlaYUVerFrame::MATCH_BITS ) )
|
||||
if( !apcFrameList[i]->haveSameFmt( apcFrameList[0], PlaYUVerFrame::MATCH_COLOR_SPACE |
|
||||
PlaYUVerFrame::MATCH_RESOLUTION |
|
||||
PlaYUVerFrame::MATCH_BITS ) )
|
||||
return false;
|
||||
|
||||
m_pcFrameDifference = new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), PlaYUVerFrame::GRAY );
|
||||
m_pcFrameDifference =
|
||||
new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), PlaYUVerFrame::GRAY );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -79,4 +81,3 @@ Void AbsoluteFrameDifference::destroy()
|
||||
delete m_pcFrameDifference;
|
||||
m_pcFrameDifference = NULL;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -28,24 +28,19 @@
|
||||
// PlaYUVerLib
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class AbsoluteFrameDifference: public PlaYUVerModuleIf
|
||||
class AbsoluteFrameDifference : public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( AbsoluteFrameDifference )
|
||||
REGISTER_CLASS_FACTORY( AbsoluteFrameDifference )
|
||||
|
||||
private:
|
||||
private:
|
||||
PlaYUVerFrame* m_pcFrameDifference;
|
||||
|
||||
public:
|
||||
public:
|
||||
AbsoluteFrameDifference();
|
||||
virtual ~AbsoluteFrameDifference()
|
||||
{
|
||||
}
|
||||
virtual ~AbsoluteFrameDifference() {}
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
PlaYUVerFrame* process( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
Void destroy();
|
||||
|
||||
};
|
||||
|
||||
#endif // __FRAMEDIFFERENCE_H__
|
||||
|
||||
#endif // __FRAMEDIFFERENCE_H__
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -35,24 +35,24 @@ DisparityStereoBM::DisparityStereoBM()
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_TWO_FRAMES;
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_SKIP_WHILE_PLAY | MODULE_REQUIRES_NEW_WINDOW | MODULE_REQUIRES_OPTIONS;
|
||||
|
||||
m_cModuleOptions.addOptions()/**/
|
||||
( "block_size", m_uiBlockSize, "Block Size (positive odd number) [9]" );
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "block_size", m_uiBlockSize, "Block Size (positive odd number) [9]" );
|
||||
|
||||
m_pcDisparityFrame = NULL;
|
||||
m_uiBlockSize = 9;
|
||||
|
||||
}
|
||||
|
||||
Bool DisparityStereoBM::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
{
|
||||
_BASIC_MODULE_API_2_CHECK_
|
||||
m_pcDisparityFrame = new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), PlaYUVerFrame::GRAY );
|
||||
m_pcDisparityFrame =
|
||||
new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), PlaYUVerFrame::GRAY );
|
||||
if( ( m_uiBlockSize % 2 ) == 0 )
|
||||
{
|
||||
m_uiBlockSize++;
|
||||
}
|
||||
m_uiNumberOfDisparities = ( ( apcFrameList[0]->getWidth() / 8 ) + 15 ) & -16;
|
||||
#if( CV_MAJOR_VERSION == 2)
|
||||
#if( CV_MAJOR_VERSION == 2 )
|
||||
m_cStereoBM.state->preFilterCap = 31;
|
||||
m_cStereoBM.state->SADWindowSize = 9;
|
||||
m_cStereoBM.state->minDisparity = 0;
|
||||
@@ -89,7 +89,7 @@ PlaYUVerFrame* DisparityStereoBM::process( std::vector<PlaYUVerFrame*> apcFrameL
|
||||
}
|
||||
cv::Mat disparityImage, disparityImage8;
|
||||
|
||||
#if( CV_MAJOR_VERSION == 2)
|
||||
#if( CV_MAJOR_VERSION == 2 )
|
||||
m_cStereoBM( leftImage, rightImage, disparityImage );
|
||||
#else
|
||||
m_cStereoBM->compute( leftImage, rightImage, disparityImage );
|
||||
@@ -107,4 +107,3 @@ Void DisparityStereoBM::destroy()
|
||||
delete m_pcDisparityFrame;
|
||||
m_pcDisparityFrame = NULL;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -31,31 +31,26 @@
|
||||
// PlaYUVerLib
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class DisparityStereoBM: public PlaYUVerModuleIf
|
||||
class DisparityStereoBM : public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( DisparityStereoBM )
|
||||
REGISTER_CLASS_FACTORY( DisparityStereoBM )
|
||||
|
||||
private:
|
||||
private:
|
||||
PlaYUVerFrame* m_pcDisparityFrame;
|
||||
Int m_uiNumberOfDisparities;
|
||||
UInt m_uiBlockSize;
|
||||
#if( CV_MAJOR_VERSION == 2)
|
||||
#if( CV_MAJOR_VERSION == 2 )
|
||||
cv::StereoBM m_cStereoBM;
|
||||
#else
|
||||
cv::Ptr<cv::StereoBM> m_cStereoBM;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
public:
|
||||
public:
|
||||
DisparityStereoBM();
|
||||
virtual ~DisparityStereoBM()
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~DisparityStereoBM() {}
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
PlaYUVerFrame* process( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
Void destroy();
|
||||
};
|
||||
|
||||
#endif // __DISPARITYSTEREOBM_H__
|
||||
|
||||
#endif // __DISPARITYSTEREOBM_H__
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -35,26 +35,27 @@ DisparityStereoSGBM::DisparityStereoSGBM()
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_TWO_FRAMES;
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_SKIP_WHILE_PLAY | MODULE_REQUIRES_NEW_WINDOW | MODULE_REQUIRES_OPTIONS;
|
||||
|
||||
m_cModuleOptions.addOptions()/**/
|
||||
( "block_size", m_uiBlockSize, "Block Size (positive odd number) [3]" )( "HHAlgorithm", m_bUseHH, "Use HH algorithm [false]" );
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "block_size", m_uiBlockSize, "Block Size (positive odd number) [3]" )( "HHAlgorithm", m_bUseHH,
|
||||
"Use HH algorithm [false]" );
|
||||
|
||||
m_pcDisparityFrame = NULL;
|
||||
m_uiBlockSize = 3;
|
||||
m_uiNumberOfDisparities = 0;
|
||||
|
||||
}
|
||||
|
||||
Bool DisparityStereoSGBM::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
{
|
||||
_BASIC_MODULE_API_2_CHECK_
|
||||
m_pcDisparityFrame = new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), PlaYUVerFrame::GRAY );
|
||||
m_pcDisparityFrame =
|
||||
new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), PlaYUVerFrame::GRAY );
|
||||
if( ( m_uiBlockSize % 2 ) == 0 )
|
||||
{
|
||||
m_uiBlockSize++;
|
||||
}
|
||||
m_uiNumberOfDisparities = ( ( apcFrameList[0]->getWidth() / 8 ) + 15 ) & -16;
|
||||
Int cn = apcFrameList[0]->getNumberChannels();
|
||||
#if( CV_MAJOR_VERSION == 3)
|
||||
#if( CV_MAJOR_VERSION == 3 )
|
||||
m_cStereoMatch = cv::StereoSGBM::create( 0, 16, m_uiBlockSize );
|
||||
m_cStereoMatch->setPreFilterCap( 63 );
|
||||
|
||||
@@ -66,7 +67,7 @@ Bool DisparityStereoSGBM::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
m_cStereoMatch->setSpeckleWindowSize( 100 );
|
||||
m_cStereoMatch->setSpeckleRange( 32 );
|
||||
m_cStereoMatch->setDisp12MaxDiff( 1 );
|
||||
//m_cStereoMatch->setMode( alg == STEREO_HH ? StereoSGBM::MODE_HH : StereoSGBM::MODE_SGBM );
|
||||
// m_cStereoMatch->setMode( alg == STEREO_HH ? StereoSGBM::MODE_HH : StereoSGBM::MODE_SGBM );
|
||||
m_cStereoMatch->setMode( m_bUseHH ? cv::StereoSGBM::MODE_HH : cv::StereoSGBM::MODE_SGBM );
|
||||
#else
|
||||
m_cStereoMatch.preFilterCap = 63;
|
||||
@@ -94,7 +95,7 @@ PlaYUVerFrame* DisparityStereoSGBM::process( std::vector<PlaYUVerFrame*> apcFram
|
||||
return m_pcDisparityFrame;
|
||||
}
|
||||
cv::Mat disparityImage, disparityImage8;
|
||||
#if( CV_MAJOR_VERSION == 3)
|
||||
#if( CV_MAJOR_VERSION == 3 )
|
||||
m_cStereoMatch->compute( leftImage, rightImage, disparityImage );
|
||||
#else
|
||||
m_cStereoMatch( leftImage, rightImage, disparityImage );
|
||||
@@ -110,4 +111,3 @@ Void DisparityStereoSGBM::destroy()
|
||||
delete m_pcDisparityFrame;
|
||||
m_pcDisparityFrame = NULL;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -43,32 +43,27 @@
|
||||
// PlaYUVerLib
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class DisparityStereoSGBM: public PlaYUVerModuleIf
|
||||
class DisparityStereoSGBM : public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( DisparityStereoSGBM )
|
||||
REGISTER_CLASS_FACTORY( DisparityStereoSGBM )
|
||||
|
||||
private:
|
||||
private:
|
||||
PlaYUVerFrame* m_pcDisparityFrame;
|
||||
Bool m_bUseHH;
|
||||
Int m_uiNumberOfDisparities;
|
||||
UInt m_uiBlockSize;
|
||||
#if( CV_MAJOR_VERSION == 3)
|
||||
#if( CV_MAJOR_VERSION == 3 )
|
||||
cv::Ptr<cv::StereoSGBM> m_cStereoMatch;
|
||||
#else
|
||||
#else
|
||||
cv::StereoSGBM m_cStereoMatch;
|
||||
#endif
|
||||
|
||||
public:
|
||||
public:
|
||||
DisparityStereoSGBM();
|
||||
virtual ~DisparityStereoSGBM()
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~DisparityStereoSGBM() {}
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
PlaYUVerFrame* process( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
Void destroy();
|
||||
};
|
||||
|
||||
#endif // __DISPARITYSTEREOSGBM_H__
|
||||
|
||||
#endif // __DISPARITYSTEREOSGBM_H__
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -36,8 +36,8 @@ DisparityStereoVar::DisparityStereoVar()
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_SKIP_WHILE_PLAY | MODULE_REQUIRES_NEW_WINDOW;
|
||||
|
||||
m_pcDisparityFrame = NULL;
|
||||
m_cStereoVar.levels = 3; // ignored with USE_AUTO_PARAMS
|
||||
m_cStereoVar.pyrScale = 0.5; // ignored with USE_AUTO_PARAMS
|
||||
m_cStereoVar.levels = 3; // ignored with USE_AUTO_PARAMS
|
||||
m_cStereoVar.pyrScale = 0.5; // ignored with USE_AUTO_PARAMS
|
||||
m_cStereoVar.nIt = 25;
|
||||
|
||||
m_cStereoVar.maxDisp = 0;
|
||||
@@ -45,15 +45,17 @@ DisparityStereoVar::DisparityStereoVar()
|
||||
m_cStereoVar.poly_sigma = 0.0;
|
||||
m_cStereoVar.fi = 15.0f;
|
||||
m_cStereoVar.lambda = 0.03f;
|
||||
m_cStereoVar.penalization = m_cStereoVar.PENALIZATION_TICHONOV; // ignored with USE_AUTO_PARAMS
|
||||
m_cStereoVar.cycle = m_cStereoVar.CYCLE_V; // ignored with USE_AUTO_PARAMS
|
||||
m_cStereoVar.flags = m_cStereoVar.USE_SMART_ID | m_cStereoVar.USE_AUTO_PARAMS | m_cStereoVar.USE_INITIAL_DISPARITY | m_cStereoVar.USE_MEDIAN_FILTERING;
|
||||
m_cStereoVar.penalization = m_cStereoVar.PENALIZATION_TICHONOV; // ignored with USE_AUTO_PARAMS
|
||||
m_cStereoVar.cycle = m_cStereoVar.CYCLE_V; // ignored with USE_AUTO_PARAMS
|
||||
m_cStereoVar.flags = m_cStereoVar.USE_SMART_ID | m_cStereoVar.USE_AUTO_PARAMS | m_cStereoVar.USE_INITIAL_DISPARITY |
|
||||
m_cStereoVar.USE_MEDIAN_FILTERING;
|
||||
}
|
||||
|
||||
Bool DisparityStereoVar::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
{
|
||||
_BASIC_MODULE_API_2_CHECK_
|
||||
m_pcDisparityFrame = new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), PlaYUVerFrame::GRAY );
|
||||
m_pcDisparityFrame =
|
||||
new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), PlaYUVerFrame::GRAY );
|
||||
m_cStereoVar.minDisp = -( ( ( apcFrameList[0]->getWidth() / 8 ) + 15 ) & -16 );
|
||||
return true;
|
||||
}
|
||||
@@ -79,4 +81,3 @@ Void DisparityStereoVar::destroy()
|
||||
delete m_pcDisparityFrame;
|
||||
m_pcDisparityFrame = NULL;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -31,24 +31,20 @@
|
||||
// PlaYUVerLib
|
||||
#include "PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class DisparityStereoVar: public PlaYUVerModuleIf
|
||||
class DisparityStereoVar : public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( DisparityStereoVar )
|
||||
REGISTER_CLASS_FACTORY( DisparityStereoVar )
|
||||
|
||||
private:
|
||||
private:
|
||||
PlaYUVerFrame* m_pcDisparityFrame;
|
||||
cv::StereoVar m_cStereoVar;
|
||||
public:
|
||||
DisparityStereoVar();
|
||||
virtual ~DisparityStereoVar()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
DisparityStereoVar();
|
||||
virtual ~DisparityStereoVar() {}
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
PlaYUVerFrame* process( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
Void destroy();
|
||||
};
|
||||
|
||||
#endif // __DISPARITYSTEREOVAR_H__
|
||||
|
||||
#endif // __DISPARITYSTEREOVAR_H__
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "EightBitsSampling.h"
|
||||
|
||||
|
||||
EightBitsSampling::EightBitsSampling()
|
||||
{
|
||||
/* Module Definition */
|
||||
@@ -44,7 +43,8 @@ Bool EightBitsSampling::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
if( apcFrameList[0]->getBitsPel() > 8 )
|
||||
{
|
||||
m_pcSubSampledFrame = NULL;
|
||||
m_pcSubSampledFrame = new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), apcFrameList[0]->getPelFormat(), 8 );
|
||||
m_pcSubSampledFrame = new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(),
|
||||
apcFrameList[0]->getPelFormat(), 8 );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -79,4 +79,3 @@ Void EightBitsSampling::destroy()
|
||||
delete m_pcSubSampledFrame;
|
||||
m_pcSubSampledFrame = NULL;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -28,23 +28,19 @@
|
||||
// PlaYUVerLib
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class EightBitsSampling: public PlaYUVerModuleIf
|
||||
class EightBitsSampling : public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( EightBitsSampling )
|
||||
REGISTER_CLASS_FACTORY( EightBitsSampling )
|
||||
|
||||
private:
|
||||
private:
|
||||
PlaYUVerFrame* m_pcSubSampledFrame;
|
||||
public:
|
||||
|
||||
public:
|
||||
EightBitsSampling();
|
||||
virtual ~EightBitsSampling()
|
||||
{
|
||||
}
|
||||
virtual ~EightBitsSampling() {}
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
PlaYUVerFrame* process( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
Void destroy();
|
||||
|
||||
};
|
||||
|
||||
#endif // __EIGHTBITSSAMPLING_H__
|
||||
|
||||
#endif // __EIGHTBITSSAMPLING_H__
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -42,7 +42,8 @@ PlaYUVerFrame* FilterComponentModule::filterComponent( PlaYUVerFrame* InputFrame
|
||||
{
|
||||
Pel*** pppOutputPelYUV = m_pcFilteredFrame->getPelBufferYUV();
|
||||
Pel*** pppInputPelYUV = InputFrame->getPelBufferYUV();
|
||||
memcpy( pppOutputPelYUV[LUMA][0], pppInputPelYUV[Component][0], m_pcFilteredFrame->getWidth() * m_pcFilteredFrame->getHeight() * sizeof(Pel) );
|
||||
memcpy( pppOutputPelYUV[LUMA][0], pppInputPelYUV[Component][0],
|
||||
m_pcFilteredFrame->getWidth() * m_pcFilteredFrame->getHeight() * sizeof( Pel ) );
|
||||
return m_pcFilteredFrame;
|
||||
}
|
||||
|
||||
@@ -62,9 +63,9 @@ FilterComponentLuma::FilterComponentLuma()
|
||||
m_pchModuleCategory = "FilterComponent"; // Category (sub-menu)
|
||||
m_pchModuleName = "Luma"; // Name
|
||||
m_pchModuleTooltip = "Filter Y matrix of YUV frame"; // Description
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_ONE_FRAME; // Number of Frames required (ONE_FRAME, TWO_FRAMES, THREE_FRAMES)
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_NOTHING; // Module requirements (check PlaYUVerModulesIf.h).
|
||||
// Several requirements should be "or" between each others.
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_ONE_FRAME; // Number of Frames required (ONE_FRAME, TWO_FRAMES, THREE_FRAMES)
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_NOTHING; // Module requirements (check PlaYUVerModulesIf.h).
|
||||
// Several requirements should be "or" between each others.
|
||||
}
|
||||
|
||||
Bool FilterComponentLuma::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
@@ -93,7 +94,8 @@ Bool FilterComponentChromaU::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
{
|
||||
if( apcFrameList[0]->getNumberChannels() > 1 )
|
||||
{
|
||||
return createFilter( apcFrameList[0]->getChromaWidth(), apcFrameList[0]->getChromaHeight(), apcFrameList[0]->getBitsPel() );
|
||||
return createFilter( apcFrameList[0]->getChromaWidth(), apcFrameList[0]->getChromaHeight(),
|
||||
apcFrameList[0]->getBitsPel() );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -119,7 +121,8 @@ Bool FilterComponentChromaV::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
{
|
||||
if( apcFrameList[0]->getNumberChannels() > 1 )
|
||||
{
|
||||
return createFilter( apcFrameList[0]->getChromaWidth(), apcFrameList[0]->getChromaHeight(), apcFrameList[0]->getBitsPel() );
|
||||
return createFilter( apcFrameList[0]->getChromaWidth(), apcFrameList[0]->getChromaHeight(),
|
||||
apcFrameList[0]->getBitsPel() );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -128,4 +131,3 @@ PlaYUVerFrame* FilterComponentChromaV::process( std::vector<PlaYUVerFrame*> apcF
|
||||
{
|
||||
return filterComponent( apcFrameList[0], CHROMA_V );
|
||||
}
|
||||
|
||||
+19
-28
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -28,16 +28,14 @@
|
||||
// PlaYUVerLib
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class FilterComponentModule: public PlaYUVerModuleIf
|
||||
class FilterComponentModule : public PlaYUVerModuleIf
|
||||
{
|
||||
private:
|
||||
private:
|
||||
PlaYUVerFrame* m_pcFilteredFrame;
|
||||
public:
|
||||
|
||||
public:
|
||||
FilterComponentModule();
|
||||
virtual ~FilterComponentModule()
|
||||
{
|
||||
}
|
||||
virtual ~FilterComponentModule() {}
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList ) = 0;
|
||||
PlaYUVerFrame* process( std::vector<PlaYUVerFrame*> apcFrameList ) = 0;
|
||||
Void destroy();
|
||||
@@ -46,41 +44,34 @@ private:
|
||||
PlaYUVerFrame* filterComponent( PlaYUVerFrame* InputFrame, Int Component );
|
||||
};
|
||||
|
||||
class FilterComponentLuma: public FilterComponentModule
|
||||
class FilterComponentLuma : public FilterComponentModule
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( FilterComponentLuma )
|
||||
public:
|
||||
REGISTER_CLASS_FACTORY( FilterComponentLuma )
|
||||
public:
|
||||
FilterComponentLuma();
|
||||
virtual ~FilterComponentLuma()
|
||||
{
|
||||
}
|
||||
virtual ~FilterComponentLuma() {}
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
PlaYUVerFrame* process( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
};
|
||||
|
||||
class FilterComponentChromaU: public FilterComponentModule
|
||||
class FilterComponentChromaU : public FilterComponentModule
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( FilterComponentChromaU )
|
||||
public:
|
||||
REGISTER_CLASS_FACTORY( FilterComponentChromaU )
|
||||
public:
|
||||
FilterComponentChromaU();
|
||||
virtual ~FilterComponentChromaU()
|
||||
{
|
||||
}
|
||||
virtual ~FilterComponentChromaU() {}
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
PlaYUVerFrame* process( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
};
|
||||
|
||||
class FilterComponentChromaV: public FilterComponentModule
|
||||
class FilterComponentChromaV : public FilterComponentModule
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( FilterComponentChromaV )
|
||||
public:
|
||||
REGISTER_CLASS_FACTORY( FilterComponentChromaV )
|
||||
public:
|
||||
FilterComponentChromaV();
|
||||
virtual ~FilterComponentChromaV()
|
||||
{
|
||||
}
|
||||
virtual ~FilterComponentChromaV() {}
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
PlaYUVerFrame* process( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
};
|
||||
|
||||
#endif // __FILTERFRAME_H__
|
||||
|
||||
#endif // __FILTERFRAME_H__
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "FrameBinarization.h"
|
||||
|
||||
|
||||
FrameBinarization::FrameBinarization()
|
||||
{
|
||||
/* Module Definition */
|
||||
@@ -35,8 +34,8 @@ FrameBinarization::FrameBinarization()
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_ONE_FRAME;
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_OPTIONS;
|
||||
|
||||
m_cModuleOptions.addOptions()/**/
|
||||
( "threshold", m_uiThreshold, "Threshold level for binarization (0-255) [128]" );
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "threshold", m_uiThreshold, "Threshold level for binarization (0-255) [128]" );
|
||||
|
||||
m_pcBinFrame = NULL;
|
||||
m_uiThreshold = 128;
|
||||
@@ -66,4 +65,3 @@ Void FrameBinarization::destroy()
|
||||
delete m_pcBinFrame;
|
||||
m_pcBinFrame = NULL;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -28,24 +28,20 @@
|
||||
// PlaYUVerLib
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class FrameBinarization: public PlaYUVerModuleIf
|
||||
class FrameBinarization : public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( FrameBinarization )
|
||||
REGISTER_CLASS_FACTORY( FrameBinarization )
|
||||
|
||||
private:
|
||||
private:
|
||||
PlaYUVerFrame* m_pcBinFrame;
|
||||
UInt m_uiThreshold;
|
||||
public:
|
||||
|
||||
public:
|
||||
FrameBinarization();
|
||||
virtual ~FrameBinarization()
|
||||
{
|
||||
}
|
||||
virtual ~FrameBinarization() {}
|
||||
Void create( PlaYUVerFrame* );
|
||||
PlaYUVerFrame* process( PlaYUVerFrame* );
|
||||
Void destroy();
|
||||
|
||||
};
|
||||
|
||||
#endif // __FRAMEBINARIZATION_H__
|
||||
|
||||
#endif // __FRAMEBINARIZATION_H__
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "FrameCrop.h"
|
||||
|
||||
|
||||
FrameCrop::FrameCrop()
|
||||
{
|
||||
/* Module Definition */
|
||||
@@ -35,11 +34,11 @@ FrameCrop::FrameCrop()
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_ONE_FRAME;
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_OPTIONS;
|
||||
|
||||
m_cModuleOptions.addOptions()/**/
|
||||
( "xPosition", m_uiXPosition, "X cordinate of the left-top corner of the crop region [0]" )/**/
|
||||
( "yPosition", m_uiYPosition, "Y cordinate of the left-top corner of the crop region [0]" )/**/
|
||||
( "width", m_iXSize, "Width of the crop region [-1]" )/**/
|
||||
( "height", m_iYSize, "Height of the crop region [-1]" );
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "xPosition", m_uiXPosition, "X cordinate of the left-top corner of the crop region [0]" ) /**/
|
||||
( "yPosition", m_uiYPosition, "Y cordinate of the left-top corner of the crop region [0]" ) /**/
|
||||
( "width", m_iXSize, "Width of the crop region [-1]" ) /**/
|
||||
( "height", m_iYSize, "Height of the crop region [-1]" );
|
||||
|
||||
m_pcCropedFrame = NULL;
|
||||
m_uiXPosition = 0;
|
||||
@@ -74,4 +73,3 @@ Void FrameCrop::destroy()
|
||||
delete m_pcCropedFrame;
|
||||
m_pcCropedFrame = NULL;
|
||||
}
|
||||
|
||||
+8
-12
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -28,27 +28,23 @@
|
||||
// PlaYUVerLib
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class FrameCrop: public PlaYUVerModuleIf
|
||||
class FrameCrop : public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( FrameCrop )
|
||||
REGISTER_CLASS_FACTORY( FrameCrop )
|
||||
|
||||
private:
|
||||
private:
|
||||
PlaYUVerFrame* m_pcCropedFrame;
|
||||
UInt m_uiXPosition;
|
||||
UInt m_uiYPosition;
|
||||
Int m_iXSize;
|
||||
Int m_iYSize;
|
||||
public:
|
||||
|
||||
public:
|
||||
FrameCrop();
|
||||
virtual ~FrameCrop()
|
||||
{
|
||||
}
|
||||
virtual ~FrameCrop() {}
|
||||
Void create( PlaYUVerFrame* );
|
||||
PlaYUVerFrame* process( PlaYUVerFrame* );
|
||||
Void destroy();
|
||||
|
||||
};
|
||||
|
||||
#endif // __FRAMECROP_H__
|
||||
|
||||
#endif // __FRAMECROP_H__
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "FrameDifference.h"
|
||||
|
||||
|
||||
FrameDifference::FrameDifference()
|
||||
{
|
||||
/* Module Definition */
|
||||
@@ -36,8 +35,8 @@ FrameDifference::FrameDifference()
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_NEW_WINDOW | MODULE_REQUIRES_OPTIONS;
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_TWO_FRAMES;
|
||||
|
||||
m_cModuleOptions.addOptions()/**/
|
||||
( "Bits per pixel", m_uiBitsPixel, "Bits per pixel (use zero to avoid scaling) [0]" );
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "Bits per pixel", m_uiBitsPixel, "Bits per pixel (use zero to avoid scaling) [0]" );
|
||||
|
||||
m_uiBitsPixel = 0;
|
||||
|
||||
@@ -51,7 +50,8 @@ Bool FrameDifference::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
UInt uiMaxBitsPixel = 0;
|
||||
for( UInt i = 0; i < apcFrameList.size(); i++ )
|
||||
{
|
||||
if( !apcFrameList[i]->haveSameFmt( apcFrameList[0], PlaYUVerFrame::MATCH_COLOR_SPACE | PlaYUVerFrame::MATCH_RESOLUTION ) )
|
||||
if( !apcFrameList[i]->haveSameFmt( apcFrameList[0],
|
||||
PlaYUVerFrame::MATCH_COLOR_SPACE | PlaYUVerFrame::MATCH_RESOLUTION ) )
|
||||
return false;
|
||||
if( apcFrameList[i]->getBitsPel() > uiMaxBitsPixel )
|
||||
{
|
||||
@@ -67,7 +67,8 @@ Bool FrameDifference::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
m_iDiffBitShift = ( uiMaxBitsPixel + 1 ) - m_uiBitsPixel;
|
||||
m_iMaxDiffValue = ( 1 << ( m_uiBitsPixel - 1 ) );
|
||||
|
||||
m_pcFrameDifference = new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), PlaYUVerFrame::GRAY, m_uiBitsPixel );
|
||||
m_pcFrameDifference = new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(),
|
||||
PlaYUVerFrame::GRAY, m_uiBitsPixel );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -101,4 +102,3 @@ Void FrameDifference::destroy()
|
||||
delete m_pcFrameDifference;
|
||||
m_pcFrameDifference = NULL;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -28,27 +28,22 @@
|
||||
// PlaYUVerLib
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class FrameDifference: public PlaYUVerModuleIf
|
||||
class FrameDifference : public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( FrameDifference )
|
||||
REGISTER_CLASS_FACTORY( FrameDifference )
|
||||
|
||||
private:
|
||||
private:
|
||||
UInt m_uiBitsPixel;
|
||||
Int m_iDiffBitShift;
|
||||
Int m_iMaxDiffValue;
|
||||
PlaYUVerFrame* m_pcFrameDifference;
|
||||
|
||||
public:
|
||||
public:
|
||||
FrameDifference();
|
||||
virtual ~FrameDifference()
|
||||
{
|
||||
}
|
||||
virtual ~FrameDifference() {}
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
PlaYUVerFrame* process( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
Void destroy();
|
||||
|
||||
};
|
||||
|
||||
#endif // __FRAMEDIFFERENCE_H__
|
||||
|
||||
#endif // __FRAMEDIFFERENCE_H__
|
||||
+16
-16
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "FrameMask.h"
|
||||
|
||||
|
||||
FrameMask::FrameMask()
|
||||
{
|
||||
/* Module Definition */
|
||||
@@ -36,8 +35,8 @@ FrameMask::FrameMask()
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_TWO_FRAMES;
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_NEW_WINDOW | MODULE_REQUIRES_OPTIONS | MODULE_USES_KEYS;
|
||||
|
||||
m_cModuleOptions.addOptions()/**/
|
||||
( "MaskWeigth", m_iWeight, "Influence of the mask [60%]" );
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "MaskWeigth", m_iWeight, "Influence of the mask [60%]" );
|
||||
|
||||
m_iWeight = 6;
|
||||
|
||||
@@ -51,7 +50,8 @@ Bool FrameMask::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
for( UInt i = 1; i < apcFrameList.size(); i++ )
|
||||
{
|
||||
if( !apcFrameList[i]->haveSameFmt( apcFrameList[0], PlaYUVerFrame::MATCH_COLOR_SPACE_IGNORE_GRAY |
|
||||
PlaYUVerFrame::MATCH_RESOLUTION | PlaYUVerFrame::MATCH_BITS ) )
|
||||
PlaYUVerFrame::MATCH_RESOLUTION |
|
||||
PlaYUVerFrame::MATCH_BITS ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -68,18 +68,19 @@ Bool FrameMask::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
}
|
||||
switch( iColorSpace )
|
||||
{
|
||||
case PlaYUVerPixel::COLOR_GRAY:
|
||||
iPelFmt = PlaYUVerFrame::GRAY;
|
||||
break;
|
||||
case PlaYUVerPixel::COLOR_YUV:
|
||||
iPelFmt = PlaYUVerFrame::YUV444p;
|
||||
break;
|
||||
case PlaYUVerPixel::COLOR_RGB:
|
||||
iPelFmt = PlaYUVerFrame::RGB24;
|
||||
break;
|
||||
case PlaYUVerPixel::COLOR_GRAY:
|
||||
iPelFmt = PlaYUVerFrame::GRAY;
|
||||
break;
|
||||
case PlaYUVerPixel::COLOR_YUV:
|
||||
iPelFmt = PlaYUVerFrame::YUV444p;
|
||||
break;
|
||||
case PlaYUVerPixel::COLOR_RGB:
|
||||
iPelFmt = PlaYUVerFrame::RGB24;
|
||||
break;
|
||||
}
|
||||
|
||||
m_pcFrameProcessed = new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), iPelFmt, apcFrameList[0]->getBitsPel() );
|
||||
m_pcFrameProcessed = new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), iPelFmt,
|
||||
apcFrameList[0]->getBitsPel() );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -128,4 +129,3 @@ Void FrameMask::destroy()
|
||||
}
|
||||
m_pcFrameProcessed = NULL;
|
||||
}
|
||||
|
||||
+7
-12
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -28,26 +28,21 @@
|
||||
// PlaYUVerLib
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class FrameMask: public PlaYUVerModuleIf
|
||||
class FrameMask : public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( FrameMask )
|
||||
REGISTER_CLASS_FACTORY( FrameMask )
|
||||
|
||||
private:
|
||||
private:
|
||||
Int m_iWeight;
|
||||
PlaYUVerFrame* m_pcFrameProcessed;
|
||||
|
||||
public:
|
||||
public:
|
||||
FrameMask();
|
||||
virtual ~FrameMask()
|
||||
{
|
||||
}
|
||||
virtual ~FrameMask() {}
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
PlaYUVerFrame* process( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
Bool keyPressed( enum Module_Key_Supported value );
|
||||
Void destroy();
|
||||
|
||||
};
|
||||
|
||||
#endif // __FRAMEMASK_H__
|
||||
|
||||
#endif // __FRAMEMASK_H__
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "FrameShift.h"
|
||||
|
||||
|
||||
FrameShift::FrameShift()
|
||||
{
|
||||
/* Module Definition */
|
||||
@@ -36,9 +35,9 @@ FrameShift::FrameShift()
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_ONE_FRAME;
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_OPTIONS | MODULE_USES_KEYS;
|
||||
|
||||
m_cModuleOptions.addOptions()/**/
|
||||
( "ShiftHorizontal", m_iShiftHor, "Amount of pixels to shift in horizontal direction" )/**/
|
||||
( "ShiftVertical", m_iShiftVer, "Amount of pixels to shift in vertical direction" );
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "ShiftHorizontal", m_iShiftHor, "Amount of pixels to shift in horizontal direction" ) /**/
|
||||
( "ShiftVertical", m_iShiftVer, "Amount of pixels to shift in vertical direction" );
|
||||
|
||||
m_pcProcessedFrame = NULL;
|
||||
m_iShiftHor = 0;
|
||||
@@ -84,11 +83,13 @@ PlaYUVerFrame* FrameShift::process( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
|
||||
xStartOut = iShiftHorChroma >= 0 ? iShiftHorChroma : 0;
|
||||
xStartIn = iShiftHorChroma >= 0 ? 0 : -iShiftHorChroma;
|
||||
xEndOut = iShiftHorChroma >= 0 ? m_pcProcessedFrame->getChromaWidth() : m_pcProcessedFrame->getChromaWidth() + iShiftHorChroma;
|
||||
xEndOut = iShiftHorChroma >= 0 ? m_pcProcessedFrame->getChromaWidth()
|
||||
: m_pcProcessedFrame->getChromaWidth() + iShiftHorChroma;
|
||||
|
||||
yStartOut = iShiftVerChroma >= 0 ? iShiftVerChroma : 0;
|
||||
yStartIn = iShiftVerChroma >= 0 ? 0 : -iShiftVerChroma;
|
||||
yEndOut = iShiftVerChroma >= 0 ? m_pcProcessedFrame->getChromaHeight() : m_pcProcessedFrame->getChromaHeight() + iShiftVerChroma;
|
||||
yEndOut = iShiftVerChroma >= 0 ? m_pcProcessedFrame->getChromaHeight()
|
||||
: m_pcProcessedFrame->getChromaHeight() + iShiftVerChroma;
|
||||
|
||||
for( UInt c = 1; c < m_pcProcessedFrame->getNumberChannels(); c++ )
|
||||
{
|
||||
@@ -139,4 +140,3 @@ Void FrameShift::destroy()
|
||||
delete m_pcProcessedFrame;
|
||||
m_pcProcessedFrame = NULL;
|
||||
}
|
||||
|
||||
+8
-12
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -28,26 +28,22 @@
|
||||
// PlaYUVerLib
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class FrameShift: public PlaYUVerModuleIf
|
||||
class FrameShift : public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( FrameShift )
|
||||
REGISTER_CLASS_FACTORY( FrameShift )
|
||||
|
||||
private:
|
||||
private:
|
||||
PlaYUVerFrame* m_pcProcessedFrame;
|
||||
Int m_iShiftHor;
|
||||
Int m_iShiftVer;
|
||||
public:
|
||||
|
||||
public:
|
||||
FrameShift();
|
||||
virtual ~FrameShift()
|
||||
{
|
||||
}
|
||||
virtual ~FrameShift() {}
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
PlaYUVerFrame* process( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
Bool keyPressed( enum Module_Key_Supported value );
|
||||
Void destroy();
|
||||
|
||||
};
|
||||
|
||||
#endif // __FrameShift_H__
|
||||
|
||||
#endif // __FrameShift_H__
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -28,17 +28,17 @@
|
||||
InterFrameVariance::InterFrameVariance()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = MODULE_API_2; // Use API version 2 (recommended).
|
||||
m_iModuleAPI = MODULE_API_2; // Use API version 2 (recommended).
|
||||
// See this example for details on the functions prototype
|
||||
m_iModuleType = FRAME_PROCESSING_MODULE; // Apply module to the frames or to the whole sequence.
|
||||
m_pchModuleCategory = "Measurements"; // Category (sub-menu)
|
||||
m_pchModuleName = "InterFrameVariance"; // Name
|
||||
m_iModuleType = FRAME_PROCESSING_MODULE; // Apply module to the frames or to the whole sequence.
|
||||
m_pchModuleCategory = "Measurements"; // Category (sub-menu)
|
||||
m_pchModuleName = "InterFrameVariance"; // Name
|
||||
m_pchModuleTooltip = "Measure the variance across several frames";
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_SEVERAL_FRAMES; // Number of Frames required (This module allows a variable number of inputs)
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_NEW_WINDOW; // Module requirements (check PlaYUVerModulesIf.h).
|
||||
m_uiNumberOfFrames =
|
||||
MODULE_REQUIRES_SEVERAL_FRAMES; // Number of Frames required (This module allows a variable number of inputs)
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_NEW_WINDOW; // Module requirements (check PlaYUVerModulesIf.h).
|
||||
// Several requirements should be "or" between each others.
|
||||
m_pcFrameVariance = NULL;
|
||||
|
||||
}
|
||||
|
||||
Bool InterFrameVariance::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
@@ -48,10 +48,13 @@ Bool InterFrameVariance::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
_BASIC_MODULE_API_2_CHECK_
|
||||
|
||||
for( UInt i = 1; i < apcFrameList.size(); i++ )
|
||||
if( !apcFrameList[i]->haveSameFmt( apcFrameList[0], PlaYUVerFrame::MATCH_COLOR_SPACE | PlaYUVerFrame::MATCH_RESOLUTION | PlaYUVerFrame::MATCH_BITS ) )
|
||||
if( !apcFrameList[i]->haveSameFmt( apcFrameList[0], PlaYUVerFrame::MATCH_COLOR_SPACE |
|
||||
PlaYUVerFrame::MATCH_RESOLUTION |
|
||||
PlaYUVerFrame::MATCH_BITS ) )
|
||||
return false;
|
||||
|
||||
m_pcFrameVariance = new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), PlaYUVerFrame::GRAY, 8 );
|
||||
m_pcFrameVariance =
|
||||
new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), PlaYUVerFrame::GRAY, 8 );
|
||||
getMem2D( &m_pVariance, apcFrameList[0]->getHeight(), apcFrameList[0]->getWidth() );
|
||||
|
||||
return true;
|
||||
@@ -82,19 +85,18 @@ PlaYUVerFrame* InterFrameVariance::process( std::vector<PlaYUVerFrame*> apcFrame
|
||||
v = *pInput[i]++;
|
||||
sum += v;
|
||||
m_pVariance[y][x] += v * v;
|
||||
|
||||
}
|
||||
//Final result of the variance for one block
|
||||
// Final result of the variance for one block
|
||||
m_pVariance[y][x] -= Double( sum * sum ) / Double( numFrames );
|
||||
m_pVariance[y][x] /= Double( numFrames );
|
||||
m_pVariance[y][x] /= Double( numFrames );
|
||||
if( m_pVariance[y][x] > maxVariance )
|
||||
maxVariance = m_pVariance[y][x];
|
||||
maxVariance = m_pVariance[y][x];
|
||||
}
|
||||
|
||||
for( UInt y = 0; y < m_pcFrameVariance->getHeight(); y++ )
|
||||
for( UInt x = 0; x < m_pcFrameVariance->getWidth(); x++ )
|
||||
{
|
||||
*pOutputPelYUV++ = m_pVariance[y][x] * 255 / maxVariance;
|
||||
*pOutputPelYUV++ = m_pVariance[y][x] * 255 / maxVariance;
|
||||
}
|
||||
return m_pcFrameVariance;
|
||||
}
|
||||
@@ -108,4 +110,3 @@ Void InterFrameVariance::destroy()
|
||||
delete m_pcFrameVariance;
|
||||
m_pcFrameVariance = NULL;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -28,24 +28,20 @@
|
||||
// PlaYUVerLib
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class InterFrameVariance: public PlaYUVerModuleIf
|
||||
class InterFrameVariance : public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( InterFrameVariance )
|
||||
|
||||
private:
|
||||
private:
|
||||
PlaYUVerFrame* m_pcFrameVariance;
|
||||
Double** m_pVariance;
|
||||
public:
|
||||
|
||||
public:
|
||||
InterFrameVariance();
|
||||
virtual ~InterFrameVariance()
|
||||
{
|
||||
}
|
||||
virtual ~InterFrameVariance() {}
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
PlaYUVerFrame* process( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
Void destroy();
|
||||
|
||||
};
|
||||
|
||||
#endif // __INTERFRAMEVARIANCE_H__
|
||||
|
||||
#endif // __INTERFRAMEVARIANCE_H__
|
||||
+9
-12
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -24,18 +24,17 @@
|
||||
|
||||
#include "LumaAverage.h"
|
||||
|
||||
|
||||
LumaAverage::LumaAverage()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleType = FRAME_MEASUREMENT_MODULE; // Apply module to the frames or to the whole sequence.
|
||||
// Currently only support for frame
|
||||
m_pchModuleCategory = "Measurements"; // Category (sub-menu)
|
||||
m_pchModuleName = "LumaAverage"; // Name
|
||||
m_pchModuleTooltip = "Measure the average of luma component"; // Description
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_ONE_FRAME; // Number of Frames required (ONE_FRAME, TWO_FRAMES, THREE_FRAMES)
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_NOTHING; // Module requirements (check PlaYUVerModulesIf.h).
|
||||
// Several requirements should be "or" between each others.
|
||||
m_iModuleType = FRAME_MEASUREMENT_MODULE; // Apply module to the frames or to the whole sequence.
|
||||
// Currently only support for frame
|
||||
m_pchModuleCategory = "Measurements"; // Category (sub-menu)
|
||||
m_pchModuleName = "LumaAverage"; // Name
|
||||
m_pchModuleTooltip = "Measure the average of luma component"; // Description
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_ONE_FRAME; // Number of Frames required (ONE_FRAME, TWO_FRAMES, THREE_FRAMES)
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_NOTHING; // Module requirements (check PlaYUVerModulesIf.h).
|
||||
// Several requirements should be "or" between each others.
|
||||
}
|
||||
|
||||
Void LumaAverage::create( PlaYUVerFrame* frame )
|
||||
@@ -57,6 +56,4 @@ Double LumaAverage::measure( PlaYUVerFrame* frame )
|
||||
|
||||
Void LumaAverage::destroy()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
+7
-12
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -28,22 +28,17 @@
|
||||
// PlaYUVerLib
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class LumaAverage: public PlaYUVerModuleIf
|
||||
class LumaAverage : public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( LumaAverage )
|
||||
REGISTER_CLASS_FACTORY( LumaAverage )
|
||||
|
||||
private:
|
||||
public:
|
||||
private:
|
||||
public:
|
||||
LumaAverage();
|
||||
virtual ~LumaAverage()
|
||||
{
|
||||
}
|
||||
virtual ~LumaAverage() {}
|
||||
Void create( PlaYUVerFrame* );
|
||||
Double measure( PlaYUVerFrame* );
|
||||
Void destroy();
|
||||
|
||||
};
|
||||
|
||||
#endif // __LUMAAVERAGE_H__
|
||||
|
||||
#endif // __LUMAAVERAGE_H__
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -42,12 +42,11 @@ MeasureOpticalFlowDualTVL1::MeasureOpticalFlowDualTVL1()
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_TWO_FRAMES;
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_SKIP_WHILE_PLAY | MODULE_REQUIRES_NEW_WINDOW | MODULE_REQUIRES_OPTIONS;
|
||||
|
||||
m_cModuleOptions.addOptions()/**/
|
||||
( "Show reconstruction", m_bShowReconstruction, "Show reconstructed frame instead of MVs [false]" );
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "Show reconstruction", m_bShowReconstruction, "Show reconstructed frame instead of MVs [false]" );
|
||||
|
||||
m_bShowReconstruction = false;
|
||||
m_pcOutputFrame = NULL;
|
||||
|
||||
}
|
||||
|
||||
Bool MeasureOpticalFlowDualTVL1::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
@@ -55,7 +54,9 @@ Bool MeasureOpticalFlowDualTVL1::create( std::vector<PlaYUVerFrame*> apcFrameLis
|
||||
_BASIC_MODULE_API_2_CHECK_
|
||||
|
||||
for( UInt i = 1; i < apcFrameList.size(); i++ )
|
||||
if( !apcFrameList[i]->haveSameFmt( apcFrameList[0], PlaYUVerFrame::MATCH_COLOR_SPACE | PlaYUVerFrame::MATCH_RESOLUTION | PlaYUVerFrame::MATCH_BITS ) )
|
||||
if( !apcFrameList[i]->haveSameFmt( apcFrameList[0], PlaYUVerFrame::MATCH_COLOR_SPACE |
|
||||
PlaYUVerFrame::MATCH_RESOLUTION |
|
||||
PlaYUVerFrame::MATCH_BITS ) )
|
||||
return false;
|
||||
|
||||
m_iStep = 16;
|
||||
@@ -79,7 +80,6 @@ Void MeasureOpticalFlowDualTVL1::drawFlow()
|
||||
{
|
||||
for( int x = m_iStep / 2; x < m_cvFlow.cols; x += m_iStep )
|
||||
{
|
||||
|
||||
Point2f u( 0, 0 );
|
||||
Double count = 0;
|
||||
for( int i = ( -m_iStep / 2 ); i < ( m_iStep / 2 ); i++ )
|
||||
@@ -116,7 +116,7 @@ Void MeasureOpticalFlowDualTVL1::compensateFlow()
|
||||
for( UInt x = 0; x < m_pcOutputFrame->getWidth( c ); x++ )
|
||||
{
|
||||
Point2f u = m_cvFlow( y, x );
|
||||
Point p( x + u.x, y + u.y);
|
||||
Point p( x + u.x, y + u.y );
|
||||
*pPelOut = pPelPrev[p.y][p.x];
|
||||
pPelOut++;
|
||||
}
|
||||
@@ -144,11 +144,9 @@ PlaYUVerFrame* MeasureOpticalFlowDualTVL1::process( std::vector<PlaYUVerFrame*>
|
||||
return m_pcOutputFrame;
|
||||
}
|
||||
|
||||
Void
|
||||
MeasureOpticalFlowDualTVL1::destroy()
|
||||
Void MeasureOpticalFlowDualTVL1::destroy()
|
||||
{
|
||||
if( m_pcOutputFrame )
|
||||
delete m_pcOutputFrame;
|
||||
m_pcOutputFrame = NULL;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -31,12 +31,11 @@
|
||||
// PlaYUVerLib
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class MeasureOpticalFlowDualTVL1: public PlaYUVerModuleIf
|
||||
class MeasureOpticalFlowDualTVL1 : public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( MeasureOpticalFlowDualTVL1 )
|
||||
REGISTER_CLASS_FACTORY( MeasureOpticalFlowDualTVL1 )
|
||||
|
||||
private:
|
||||
private:
|
||||
Bool m_bShowReconstruction;
|
||||
Int m_iStep;
|
||||
cv::Ptr<cv::DenseOpticalFlow> m_cTvl1;
|
||||
@@ -48,16 +47,12 @@ private:
|
||||
Void drawFlow();
|
||||
Void compensateFlow();
|
||||
|
||||
public:
|
||||
public:
|
||||
MeasureOpticalFlowDualTVL1();
|
||||
virtual ~MeasureOpticalFlowDualTVL1()
|
||||
{
|
||||
}
|
||||
virtual ~MeasureOpticalFlowDualTVL1() {}
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
PlaYUVerFrame* process( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
Void destroy();
|
||||
|
||||
};
|
||||
|
||||
#endif // __MeasureOpticalFlowDualTVL1_H__
|
||||
|
||||
#endif // __MeasureOpticalFlowDualTVL1_H__
|
||||
+9
-16
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -38,7 +38,6 @@ using cv::Ptr;
|
||||
using cv::Point;
|
||||
using cv::Point2f;
|
||||
|
||||
|
||||
OpticalFlowModule::OpticalFlowModule()
|
||||
{
|
||||
/* Module Definition */
|
||||
@@ -48,12 +47,11 @@ OpticalFlowModule::OpticalFlowModule()
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_TWO_FRAMES;
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_SKIP_WHILE_PLAY | MODULE_REQUIRES_NEW_WINDOW | MODULE_REQUIRES_OPTIONS;
|
||||
|
||||
m_cModuleOptions.addOptions()/**/
|
||||
( "Show reconstruction", m_bShowReconstruction, "Show reconstructed frame instead of MVs [false]" );
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "Show reconstruction", m_bShowReconstruction, "Show reconstructed frame instead of MVs [false]" );
|
||||
|
||||
m_bShowReconstruction = false;
|
||||
m_pcOutputFrame = NULL;
|
||||
|
||||
}
|
||||
|
||||
Bool OpticalFlowModule::commonCreate( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
@@ -61,7 +59,9 @@ Bool OpticalFlowModule::commonCreate( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
_BASIC_MODULE_API_2_CHECK_
|
||||
|
||||
for( UInt i = 1; i < apcFrameList.size(); i++ )
|
||||
if( !apcFrameList[i]->haveSameFmt( apcFrameList[0], PlaYUVerFrame::MATCH_COLOR_SPACE | PlaYUVerFrame::MATCH_RESOLUTION | PlaYUVerFrame::MATCH_BITS ) )
|
||||
if( !apcFrameList[i]->haveSameFmt( apcFrameList[0], PlaYUVerFrame::MATCH_COLOR_SPACE |
|
||||
PlaYUVerFrame::MATCH_RESOLUTION |
|
||||
PlaYUVerFrame::MATCH_BITS ) )
|
||||
return false;
|
||||
|
||||
m_iStep = 16;
|
||||
@@ -84,7 +84,6 @@ Void OpticalFlowModule::drawFlow()
|
||||
{
|
||||
for( int x = m_iStep / 2; x < m_cvFlow.cols; x += m_iStep )
|
||||
{
|
||||
|
||||
Point2f u( 0, 0 );
|
||||
Double count = 0;
|
||||
for( int i = ( -m_iStep / 2 ); i < ( m_iStep / 2 ); i++ )
|
||||
@@ -121,7 +120,7 @@ Void OpticalFlowModule::compensateFlow()
|
||||
for( UInt x = 0; x < m_pcOutputFrame->getWidth( c ); x++ )
|
||||
{
|
||||
Point2f u = m_cvFlow( y, x );
|
||||
Point p( x + u.x, y + u.y);
|
||||
Point p( x + u.x, y + u.y );
|
||||
*pPelOut = pPelPrev[p.y][p.x];
|
||||
pPelOut++;
|
||||
}
|
||||
@@ -154,9 +153,8 @@ Void OpticalFlowModule::destroy()
|
||||
if( m_pcOutputFrame )
|
||||
delete m_pcOutputFrame;
|
||||
m_pcOutputFrame = NULL;
|
||||
// if( m_cOpticalFlow )
|
||||
// delete m_cOpticalFlow;
|
||||
|
||||
// if( m_cOpticalFlow )
|
||||
// delete m_cOpticalFlow;
|
||||
}
|
||||
|
||||
OpticalFlowDualTVL1::OpticalFlowDualTVL1()
|
||||
@@ -164,7 +162,6 @@ OpticalFlowDualTVL1::OpticalFlowDualTVL1()
|
||||
/* Module Definition */
|
||||
m_pchModuleName = "OpticalFlowDualTVL1";
|
||||
m_pchModuleTooltip = "Measure optical flow using DualTVL1 method";
|
||||
|
||||
}
|
||||
|
||||
Bool OpticalFlowDualTVL1::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
@@ -181,7 +178,6 @@ OpticalFlowSparseToDense::OpticalFlowSparseToDense()
|
||||
/* Module Definition */
|
||||
m_pchModuleName = "OpticalFlowSparseToDense";
|
||||
m_pchModuleTooltip = "Measure optical flow using SparseToDense method";
|
||||
|
||||
}
|
||||
|
||||
Bool OpticalFlowSparseToDense::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
@@ -198,7 +194,6 @@ OpticalFlowFarneback::OpticalFlowFarneback()
|
||||
/* Module Definition */
|
||||
m_pchModuleName = "OpticalFlowFarneback";
|
||||
m_pchModuleTooltip = "Measure optical flow using Farneback method";
|
||||
|
||||
}
|
||||
|
||||
Bool OpticalFlowFarneback::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
@@ -215,7 +210,6 @@ OpticalDeepFlow::OpticalDeepFlow()
|
||||
/* Module Definition */
|
||||
m_pchModuleName = "OpticalDeepFlow";
|
||||
m_pchModuleTooltip = "Measure optical flow using Farneback method";
|
||||
|
||||
}
|
||||
|
||||
Bool OpticalDeepFlow::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
@@ -226,4 +220,3 @@ Bool OpticalDeepFlow::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
m_cOpticalFlow = cv::optflow::createOptFlow_DeepFlow();
|
||||
return bRet;
|
||||
}
|
||||
|
||||
+19
-33
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -32,10 +32,9 @@
|
||||
// PlaYUVerLib
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class OpticalFlowModule: public PlaYUVerModuleIf
|
||||
class OpticalFlowModule : public PlaYUVerModuleIf
|
||||
{
|
||||
protected:
|
||||
protected:
|
||||
Bool m_bShowReconstruction;
|
||||
Int m_iStep;
|
||||
cv::Ptr<cv::DenseOpticalFlow> m_cOpticalFlow;
|
||||
@@ -46,61 +45,48 @@ protected:
|
||||
Void drawFlow();
|
||||
Void compensateFlow();
|
||||
Bool commonCreate( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
public:
|
||||
|
||||
public:
|
||||
OpticalFlowModule();
|
||||
virtual ~OpticalFlowModule()
|
||||
{
|
||||
}
|
||||
virtual ~OpticalFlowModule() {}
|
||||
PlaYUVerFrame* process( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
Void destroy();
|
||||
};
|
||||
|
||||
|
||||
class OpticalFlowDualTVL1: public OpticalFlowModule
|
||||
class OpticalFlowDualTVL1 : public OpticalFlowModule
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( OpticalFlowDualTVL1 )
|
||||
public:
|
||||
public:
|
||||
OpticalFlowDualTVL1();
|
||||
virtual ~OpticalFlowDualTVL1()
|
||||
{
|
||||
}
|
||||
virtual ~OpticalFlowDualTVL1() {}
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
};
|
||||
|
||||
class OpticalFlowSparseToDense: public OpticalFlowModule
|
||||
class OpticalFlowSparseToDense : public OpticalFlowModule
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( OpticalFlowSparseToDense )
|
||||
public:
|
||||
public:
|
||||
OpticalFlowSparseToDense();
|
||||
virtual ~OpticalFlowSparseToDense()
|
||||
{
|
||||
}
|
||||
virtual ~OpticalFlowSparseToDense() {}
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
};
|
||||
|
||||
|
||||
class OpticalFlowFarneback: public OpticalFlowModule
|
||||
class OpticalFlowFarneback : public OpticalFlowModule
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( OpticalFlowFarneback )
|
||||
public:
|
||||
public:
|
||||
OpticalFlowFarneback();
|
||||
virtual ~OpticalFlowFarneback()
|
||||
{
|
||||
}
|
||||
virtual ~OpticalFlowFarneback() {}
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
};
|
||||
|
||||
class OpticalDeepFlow: public OpticalFlowModule
|
||||
class OpticalDeepFlow : public OpticalFlowModule
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( OpticalDeepFlow )
|
||||
public:
|
||||
public:
|
||||
OpticalDeepFlow();
|
||||
virtual ~OpticalDeepFlow()
|
||||
{
|
||||
}
|
||||
virtual ~OpticalDeepFlow() {}
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
};
|
||||
|
||||
|
||||
#endif // __OPTICALFLOW_H__
|
||||
|
||||
#endif // __OPTICALFLOW_H__
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -34,7 +34,6 @@
|
||||
// Generated by cmake
|
||||
#include "ModulesListHeader.h"
|
||||
|
||||
|
||||
PlaYUVerModuleFactory::PlaYUVerModuleFactory()
|
||||
{
|
||||
REGISTER_ALL_MODULES
|
||||
@@ -53,14 +52,13 @@ Void PlaYUVerModuleFactory::Register( const char* moduleName, CreateModuleFn pfn
|
||||
Bool PlaYUVerModuleFactory::RegisterDl( const char* dlName )
|
||||
{
|
||||
#ifdef USE_DYNLOAD
|
||||
void *pHndl = dlopen( dlName, RTLD_NOW );
|
||||
void* pHndl = dlopen( dlName, RTLD_NOW );
|
||||
if( pHndl == NULL )
|
||||
{
|
||||
std::cerr << dlerror()
|
||||
<< std::endl;
|
||||
std::cerr << dlerror() << std::endl;
|
||||
return false;
|
||||
}
|
||||
CreateModuleFn pfnCreate = ( CreateModuleFn )dlsym( pHndl, "Maker" );
|
||||
CreateModuleFn pfnCreate = (CreateModuleFn)dlsym( pHndl, "Maker" );
|
||||
if( pfnCreate == NULL )
|
||||
{
|
||||
return false;
|
||||
@@ -72,7 +70,7 @@ Bool PlaYUVerModuleFactory::RegisterDl( const char* dlName )
|
||||
#endif
|
||||
}
|
||||
|
||||
PlaYUVerModuleIf *PlaYUVerModuleFactory::CreateModule( const char* moduleName )
|
||||
PlaYUVerModuleIf* PlaYUVerModuleFactory::CreateModule( const char* moduleName )
|
||||
{
|
||||
PlaYUVerModuleFactoryMap& PlaYUVerModuleFactoryMap = PlaYUVerModuleFactory::Get()->getMap();
|
||||
PlaYUVerModuleFactoryMap::iterator it = PlaYUVerModuleFactoryMap.begin();
|
||||
@@ -85,4 +83,3 @@ PlaYUVerModuleIf *PlaYUVerModuleFactory::CreateModule( const char* moduleName )
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -30,26 +30,23 @@
|
||||
// PlaYUVerLib
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
#define REGISTER_MODULE(X) Register( "X", &(X::Create) );
|
||||
#define REGISTER_MODULE( X ) Register( "X", &( X::Create ) );
|
||||
|
||||
typedef PlaYUVerModuleIf* (*CreateModuleFn)( void );
|
||||
typedef std::map<const char *, CreateModuleFn> PlaYUVerModuleFactoryMap;
|
||||
typedef PlaYUVerModuleIf* ( *CreateModuleFn )( void );
|
||||
typedef std::map<const char*, CreateModuleFn> PlaYUVerModuleFactoryMap;
|
||||
|
||||
// Factory for creating instances of PlaYUVerModuleIf
|
||||
class PlaYUVerModuleFactory
|
||||
{
|
||||
private:
|
||||
private:
|
||||
PlaYUVerModuleFactory();
|
||||
PlaYUVerModuleFactory &operator=( const PlaYUVerModuleFactory & )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
PlaYUVerModuleFactory& operator=( const PlaYUVerModuleFactory& ) { return *this; }
|
||||
PlaYUVerModuleFactoryMap m_FactoryMap;
|
||||
public:
|
||||
|
||||
public:
|
||||
~PlaYUVerModuleFactory();
|
||||
|
||||
static PlaYUVerModuleFactory *Get()
|
||||
static PlaYUVerModuleFactory* Get()
|
||||
{
|
||||
static PlaYUVerModuleFactory instance;
|
||||
return &instance;
|
||||
@@ -58,12 +55,8 @@ private:
|
||||
Void Register( const char* moduleName, CreateModuleFn pfnCreate );
|
||||
Bool RegisterDl( const char* dlName );
|
||||
|
||||
PlaYUVerModuleIf *CreateModule( const char *moduleName );
|
||||
PlaYUVerModuleFactoryMap& getMap()
|
||||
{
|
||||
return m_FactoryMap;
|
||||
}
|
||||
PlaYUVerModuleIf* CreateModule( const char* moduleName );
|
||||
PlaYUVerModuleFactoryMap& getMap() { return m_FactoryMap; }
|
||||
};
|
||||
|
||||
#endif // __PLAYUVERMODULESFACTORY_H__
|
||||
|
||||
#endif // __PLAYUVERMODULESFACTORY_H__
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -35,13 +35,13 @@ SetChromaHalfScale::SetChromaHalfScale()
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_NOTHING;
|
||||
|
||||
m_pcProcessedFrame = NULL;
|
||||
|
||||
}
|
||||
|
||||
Void SetChromaHalfScale::create( PlaYUVerFrame* frame )
|
||||
{
|
||||
m_pcProcessedFrame = NULL;
|
||||
m_pcProcessedFrame = new PlaYUVerFrame( frame->getWidth(), frame->getHeight(), frame->getPelFormat(), frame->getBitsPel() );
|
||||
m_pcProcessedFrame =
|
||||
new PlaYUVerFrame( frame->getWidth(), frame->getHeight(), frame->getPelFormat(), frame->getBitsPel() );
|
||||
}
|
||||
|
||||
PlaYUVerFrame* SetChromaHalfScale::process( PlaYUVerFrame* frame )
|
||||
@@ -67,4 +67,3 @@ Void SetChromaHalfScale::destroy()
|
||||
delete m_pcProcessedFrame;
|
||||
m_pcProcessedFrame = NULL;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -28,22 +28,19 @@
|
||||
// PlaYUVerLib
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
class SetChromaHalfScale: public PlaYUVerModuleIf
|
||||
class SetChromaHalfScale : public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( SetChromaHalfScale )
|
||||
REGISTER_CLASS_FACTORY( SetChromaHalfScale )
|
||||
|
||||
private:
|
||||
private:
|
||||
PlaYUVerFrame* m_pcProcessedFrame;
|
||||
public:
|
||||
|
||||
public:
|
||||
SetChromaHalfScale();
|
||||
virtual ~SetChromaHalfScale()
|
||||
{
|
||||
}
|
||||
virtual ~SetChromaHalfScale() {}
|
||||
Void create( PlaYUVerFrame* );
|
||||
PlaYUVerFrame* process( PlaYUVerFrame* );
|
||||
Void destroy();
|
||||
|
||||
};
|
||||
|
||||
#endif // _SETCHROMAHALFSCALE_H_
|
||||
|
||||
#endif // _SETCHROMAHALFSCALE_H_
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -36,11 +36,10 @@ WeightedPSNR::WeightedPSNR()
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_OPTIONS;
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_THREE_FRAMES;
|
||||
|
||||
m_cModuleOptions.addOptions()/**/
|
||||
( "Component", m_uiComponent, "Select the component to compute quality [0]" );
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "Component", m_uiComponent, "Select the component to compute quality [0]" );
|
||||
|
||||
m_uiComponent = 0;
|
||||
|
||||
}
|
||||
|
||||
Bool WeightedPSNR::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
@@ -113,6 +112,4 @@ Double WeightedPSNR::measure( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
|
||||
Void WeightedPSNR::destroy()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
+7
-11
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2016 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -28,23 +28,19 @@
|
||||
// PlaYUVerLib
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
class WeightedPSNR: public PlaYUVerModuleIf
|
||||
class WeightedPSNR : public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( WeightedPSNR )
|
||||
REGISTER_CLASS_FACTORY( WeightedPSNR )
|
||||
|
||||
private:
|
||||
private:
|
||||
UInt m_uiComponent;
|
||||
|
||||
public:
|
||||
public:
|
||||
WeightedPSNR();
|
||||
virtual ~WeightedPSNR()
|
||||
{
|
||||
}
|
||||
virtual ~WeightedPSNR() {}
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
Double measure( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
Void destroy();
|
||||
|
||||
};
|
||||
|
||||
#endif // __WEIGHTEDPSNR_H__
|
||||
|
||||
#endif // __WEIGHTEDPSNR_H__
|
||||
Reference in new issue
Block a user