Format code
This commit is contained in:
1 parent
501e24fc5d
commit
404e58e0ce
109 files changed
+494
-593
No files matched your search
@@ -25,7 +25,6 @@
|
||||
#include "AbsoluteFrameDifference.h"
|
||||
#include <cstdlib>
|
||||
|
||||
|
||||
AbsoluteFrameDifference::AbsoluteFrameDifference()
|
||||
{
|
||||
/* Module Definition */
|
||||
@@ -48,7 +47,7 @@ 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 );
|
||||
@@ -81,5 +80,3 @@ Void AbsoluteFrameDifference::destroy()
|
||||
m_pcFrameDifference = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
|
||||
class AbsoluteFrameDifference: public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( AbsoluteFrameDifference )
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
|
||||
#include "DisparityStereoBM.h"
|
||||
|
||||
|
||||
DisparityStereoBM::DisparityStereoBM()
|
||||
{
|
||||
/* Module Definition */
|
||||
@@ -111,5 +110,3 @@ Void DisparityStereoBM::destroy()
|
||||
m_pcDisparityFrame = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
|
||||
class DisparityStereoBM: public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( DisparityStereoBM )
|
||||
@@ -40,11 +39,11 @@ 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:
|
||||
DisparityStereoBM();
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
|
||||
#include "DisparityStereoSGBM.h"
|
||||
|
||||
|
||||
DisparityStereoSGBM::DisparityStereoSGBM()
|
||||
{
|
||||
/* Module Definition */
|
||||
@@ -114,5 +113,3 @@ Void DisparityStereoSGBM::destroy()
|
||||
m_pcDisparityFrame = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
|
||||
class DisparityStereoSGBM: public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( DisparityStereoSGBM )
|
||||
@@ -53,9 +52,9 @@ private:
|
||||
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
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
|
||||
#include "DisparityStereoVar.h"
|
||||
|
||||
|
||||
DisparityStereoVar::DisparityStereoVar()
|
||||
{
|
||||
/* Module Definition */
|
||||
@@ -83,5 +82,3 @@ Void DisparityStereoVar::destroy()
|
||||
m_pcDisparityFrame = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,15 +31,14 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
|
||||
class DisparityStereoVar: public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( DisparityStereoVar )
|
||||
REGISTER_CLASS_FACTORY( DisparityStereoVar )
|
||||
|
||||
private:
|
||||
PlaYUVerFrame* m_pcDisparityFrame;
|
||||
cv::StereoVar m_cStereoVar;
|
||||
public:
|
||||
public:
|
||||
DisparityStereoVar();
|
||||
virtual ~DisparityStereoVar()
|
||||
{
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "EightBitsSampling.h"
|
||||
|
||||
|
||||
EightBitsSampling::EightBitsSampling()
|
||||
{
|
||||
/* Module Definition */
|
||||
@@ -80,5 +79,3 @@ Void EightBitsSampling::destroy()
|
||||
m_pcSubSampledFrame = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,14 +27,13 @@
|
||||
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class EightBitsSampling: public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( EightBitsSampling )
|
||||
|
||||
private:
|
||||
PlaYUVerFrame* m_pcSubSampledFrame;
|
||||
public:
|
||||
public:
|
||||
EightBitsSampling();
|
||||
virtual ~EightBitsSampling()
|
||||
{
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <cstring>
|
||||
#include "FilterComponent.h"
|
||||
|
||||
|
||||
FilterComponentModule::FilterComponentModule()
|
||||
{
|
||||
m_pcFilteredFrame = NULL;
|
||||
@@ -130,5 +129,3 @@ PlaYUVerFrame* FilterComponentChromaV::process( std::vector<PlaYUVerFrame*> apcF
|
||||
return filterComponent( apcFrameList[0], CHROMA_V );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,12 +27,11 @@
|
||||
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class FilterComponentModule: public PlaYUVerModuleIf
|
||||
{
|
||||
private:
|
||||
PlaYUVerFrame* m_pcFilteredFrame;
|
||||
public:
|
||||
public:
|
||||
FilterComponentModule();
|
||||
virtual ~FilterComponentModule()
|
||||
{
|
||||
@@ -48,7 +47,7 @@ public:
|
||||
class FilterComponentLuma: public FilterComponentModule
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( FilterComponentLuma )
|
||||
public:
|
||||
public:
|
||||
FilterComponentLuma();
|
||||
virtual ~FilterComponentLuma()
|
||||
{
|
||||
@@ -60,7 +59,7 @@ public:
|
||||
class FilterComponentChromaU: public FilterComponentModule
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( FilterComponentChromaU )
|
||||
public:
|
||||
public:
|
||||
FilterComponentChromaU();
|
||||
virtual ~FilterComponentChromaU()
|
||||
{
|
||||
@@ -72,7 +71,7 @@ public:
|
||||
class FilterComponentChromaV: public FilterComponentModule
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( FilterComponentChromaV )
|
||||
public:
|
||||
public:
|
||||
FilterComponentChromaV();
|
||||
virtual ~FilterComponentChromaV()
|
||||
{
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "FrameBinarization.h"
|
||||
|
||||
|
||||
FrameBinarization::FrameBinarization()
|
||||
{
|
||||
/* Module Definition */
|
||||
@@ -67,5 +66,3 @@ Void FrameBinarization::destroy()
|
||||
m_pcBinFrame = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class FrameBinarization: public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( FrameBinarization )
|
||||
@@ -35,7 +34,7 @@ REGISTER_CLASS_FACTORY( FrameBinarization )
|
||||
private:
|
||||
PlaYUVerFrame* m_pcBinFrame;
|
||||
UInt m_uiThreshold;
|
||||
public:
|
||||
public:
|
||||
FrameBinarization();
|
||||
virtual ~FrameBinarization()
|
||||
{
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "FrameCrop.h"
|
||||
|
||||
|
||||
FrameCrop::FrameCrop()
|
||||
{
|
||||
/* Module Definition */
|
||||
@@ -75,5 +74,3 @@ Void FrameCrop::destroy()
|
||||
m_pcCropedFrame = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-2
@@ -27,7 +27,6 @@
|
||||
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class FrameCrop: public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( FrameCrop )
|
||||
@@ -38,7 +37,7 @@ private:
|
||||
UInt m_uiYPosition;
|
||||
Int m_iXSize;
|
||||
Int m_iYSize;
|
||||
public:
|
||||
public:
|
||||
FrameCrop();
|
||||
virtual ~FrameCrop()
|
||||
{
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "FrameDifference.h"
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
FrameDifference::FrameDifference()
|
||||
{
|
||||
/* Module Definition */
|
||||
@@ -103,5 +102,3 @@ Void FrameDifference::destroy()
|
||||
m_pcFrameDifference = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
|
||||
class FrameDifference: public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( FrameDifference )
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <algorithm>
|
||||
class be;
|
||||
|
||||
|
||||
FrameMask::FrameMask()
|
||||
{
|
||||
/* Module Definition */
|
||||
@@ -53,13 +52,13 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
m_iWeight = m_iWeight > 100 || m_iWeight < 0 ? 5 : m_iWeight;
|
||||
m_iWeight = m_iWeight > 100 || m_iWeight < 0 ? 5 : m_iWeight;
|
||||
m_iWeight = m_iWeight > 10 ? m_iWeight / 10 : m_iWeight;
|
||||
|
||||
Int iPelFmt = 0;
|
||||
@@ -109,7 +108,7 @@ PlaYUVerFrame* FrameMask::process( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
|
||||
Bool FrameMask::keyPressed( enum Module_Key_Supported value )
|
||||
{
|
||||
if( value == MODULE_KEY_UP && m_iWeight < 10)
|
||||
if( value == MODULE_KEY_UP && m_iWeight < 10 )
|
||||
{
|
||||
m_iWeight += 1;
|
||||
return true;
|
||||
@@ -122,7 +121,6 @@ Bool FrameMask::keyPressed( enum Module_Key_Supported value )
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Void FrameMask::destroy()
|
||||
{
|
||||
if( m_pcFrameProcessed )
|
||||
@@ -132,5 +130,3 @@ Void FrameMask::destroy()
|
||||
m_pcFrameProcessed = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-5
@@ -29,10 +29,9 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
|
||||
class FrameMask: public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( FrameMask )
|
||||
REGISTER_CLASS_FACTORY( FrameMask )
|
||||
|
||||
private:
|
||||
Int m_iWeight;
|
||||
@@ -52,6 +51,3 @@ public:
|
||||
|
||||
#endif // __FRAMEMASK_H__
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "FrameShift.h"
|
||||
|
||||
|
||||
FrameShift::FrameShift()
|
||||
{
|
||||
/* Module Definition */
|
||||
@@ -93,7 +92,6 @@ PlaYUVerFrame* FrameShift::process( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
yStartIn = iShiftVerChroma >= 0 ? 0 : -iShiftVerChroma;
|
||||
yEndOut = iShiftVerChroma >= 0 ? m_pcProcessedFrame->getChromaHeight() : m_pcProcessedFrame->getChromaHeight() + iShiftVerChroma;
|
||||
|
||||
|
||||
for( UInt c = 1; c < m_pcProcessedFrame->getNumberChannels(); c++ )
|
||||
{
|
||||
for( UInt y = yStartOut, yIn = yStartIn; y < yEndOut; y++, yIn++ )
|
||||
@@ -144,5 +142,3 @@ Void FrameShift::destroy()
|
||||
m_pcProcessedFrame = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class FrameShift: public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( FrameShift )
|
||||
@@ -36,12 +35,12 @@ private:
|
||||
PlaYUVerFrame* m_pcProcessedFrame;
|
||||
Int m_iShiftHor;
|
||||
Int m_iShiftVer;
|
||||
public:
|
||||
public:
|
||||
FrameShift();
|
||||
virtual ~FrameShift()
|
||||
{
|
||||
}
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList);
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
PlaYUVerFrame* process( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
Bool keyPressed( enum Module_Key_Supported value );
|
||||
Void destroy();
|
||||
|
||||
@@ -22,16 +22,14 @@
|
||||
* \brief Luma frame average
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __LUMAAVERAGE_H__
|
||||
#define __LUMAAVERAGE_H__
|
||||
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class LumaAverage: public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( LumaAverage )
|
||||
REGISTER_CLASS_FACTORY( LumaAverage )
|
||||
|
||||
private:
|
||||
public:
|
||||
|
||||
@@ -32,8 +32,6 @@ using cv::Ptr;
|
||||
using cv::Point;
|
||||
using cv::Point2f;
|
||||
|
||||
|
||||
|
||||
OpticalFlowDualTVL1::OpticalFlowDualTVL1()
|
||||
{
|
||||
/* Module Definition */
|
||||
@@ -79,7 +77,6 @@ PlaYUVerFrame* OpticalFlowDualTVL1::process( std::vector<PlaYUVerFrame*> apcFram
|
||||
Mat_<Point2f> flow;
|
||||
m_cTvl1->calc( cvMatPrev, cvMatAfter, flow );
|
||||
|
||||
|
||||
// determine motion range:
|
||||
Double maxrad = 1;
|
||||
|
||||
@@ -94,17 +91,17 @@ PlaYUVerFrame* OpticalFlowDualTVL1::process( std::vector<PlaYUVerFrame*> apcFram
|
||||
}
|
||||
}
|
||||
|
||||
Scalar vectorColor( 255,0,0,0 );
|
||||
Scalar vectorColor( 255, 0, 0, 0 );
|
||||
for( int y = m_iStep / 2; y < flow.rows; y += m_iStep )
|
||||
{
|
||||
for( int x = m_iStep / 2; x < flow.cols; x += m_iStep )
|
||||
{
|
||||
Point p = Point( x,y );
|
||||
Point p = Point( x, y );
|
||||
Point2f u = flow( y, x );
|
||||
Point ui( u.x, u.y );
|
||||
|
||||
if( isFlowCorrect( u ) )
|
||||
arrowedLine( cvMatAfter, p, p+ui, vectorColor );
|
||||
arrowedLine( cvMatAfter, p, p + ui, vectorColor );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,5 +116,3 @@ Void OpticalFlowDualTVL1::destroy()
|
||||
m_pcOutputFrame = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class OpticalFlowDualTVL1: public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( OpticalFlowDualTVL1 )
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include "PlaYUVerModuleFactory.h"
|
||||
#include "ModulesListHeader.h"
|
||||
|
||||
|
||||
PlaYUVerModuleFactory::PlaYUVerModuleFactory()
|
||||
{
|
||||
REGISTER_ALL_MODULES
|
||||
@@ -54,7 +53,7 @@ Bool PlaYUVerModuleFactory::RegisterDl( const char* dlName )
|
||||
if( pHndl == NULL )
|
||||
{
|
||||
std::cerr << dlerror()
|
||||
<< std::endl;
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
CreateModuleFn pfnCreate = ( CreateModuleFn )dlsym( pHndl, "Maker" );
|
||||
@@ -83,4 +82,3 @@ PlaYUVerModuleIf *PlaYUVerModuleFactory::CreateModule( const char* moduleName )
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include <map>
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
#define REGISTER_MODULE(X) Register( "X", &(X::Create) );
|
||||
|
||||
typedef PlaYUVerModuleIf* (*CreateModuleFn)( void );
|
||||
@@ -46,7 +45,7 @@ private:
|
||||
}
|
||||
|
||||
PlaYUVerModuleFactoryMap m_FactoryMap;
|
||||
public:
|
||||
public:
|
||||
~PlaYUVerModuleFactory();
|
||||
|
||||
static PlaYUVerModuleFactory *Get()
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "SetChromaHalfScale.h"
|
||||
|
||||
|
||||
SetChromaHalfScale::SetChromaHalfScale()
|
||||
{
|
||||
/* Module Definition */
|
||||
@@ -69,5 +68,3 @@ Void SetChromaHalfScale::destroy()
|
||||
m_pcProcessedFrame = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,14 +27,13 @@
|
||||
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
|
||||
|
||||
class SetChromaHalfScale: public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( SetChromaHalfScale )
|
||||
|
||||
private:
|
||||
PlaYUVerFrame* m_pcProcessedFrame;
|
||||
public:
|
||||
public:
|
||||
SetChromaHalfScale();
|
||||
virtual ~SetChromaHalfScale()
|
||||
{
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
|
||||
WeightedPSNR::WeightedPSNR()
|
||||
{
|
||||
/* Module Definition */
|
||||
@@ -103,7 +102,6 @@ Double measureWMSE( Int component, PlaYUVerFrame* Org, PlaYUVerFrame* Rec, PlaYU
|
||||
return ssd / Double( count );
|
||||
}
|
||||
|
||||
|
||||
Double WeightedPSNR::measure( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
{
|
||||
Double dPSNR = 100;
|
||||
@@ -119,5 +117,3 @@ Void WeightedPSNR::destroy()
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
|
||||
class WeightedPSNR: public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( WeightedPSNR )
|
||||
|
||||
Reference in new issue
Block a user