Change apply when playing and add OPTIONS requirement
This commit is contained in:
1 parent
48bf385f4c
commit
4a4e0c1890
8 files changed
+70
-63
No files matched your search
@@ -37,8 +37,6 @@ AbsoluteFrameDifference::AbsoluteFrameDifference()
|
||||
m_pchModuleTooltip = "Measure the absolute difference between two images (Y plane), e. g., abs( Y1 - Y2 )";
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_NEW_WINDOW;
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_TWO_FRAMES;
|
||||
m_bApplyWhilePlaying = APPLY_WHILE_PLAYING;
|
||||
|
||||
m_pcFrameDifference = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,8 +37,7 @@ DisparityStereoVar::DisparityStereoVar()
|
||||
m_pchModuleName = "StereoVar";
|
||||
m_pchModuleTooltip = "Measure the disparity between two images using the Stereo Var method (OpenCV)";
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_TWO_FRAMES;
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_NEW_WINDOW;
|
||||
m_bApplyWhilePlaying = !APPLY_WHILE_PLAYING;
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_SKIP_WHILE_PLAY | MODULE_REQUIRES_NEW_WINDOW;
|
||||
|
||||
m_pcDisparityFrame = NULL;
|
||||
m_cStereoVar.levels = 3; // ignored with USE_AUTO_PARAMS
|
||||
|
||||
@@ -66,7 +66,6 @@ FilterComponentLuma::FilterComponentLuma()
|
||||
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_bApplyWhilePlaying = APPLY_WHILE_PLAYING; // Apply module while playing
|
||||
}
|
||||
|
||||
Void FilterComponentLuma::create( PlaYUVerFrame* InputFrame )
|
||||
@@ -88,7 +87,6 @@ FilterComponentChromaU::FilterComponentChromaU()
|
||||
m_pchModuleTooltip = "Filter U matrix of YUV frame";
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_ONE_FRAME;
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_NOTHING;
|
||||
m_bApplyWhilePlaying = !APPLY_WHILE_PLAYING;
|
||||
}
|
||||
|
||||
Void FilterComponentChromaU::create( PlaYUVerFrame* InputFrame )
|
||||
@@ -110,7 +108,6 @@ FilterComponentChromaV::FilterComponentChromaV()
|
||||
m_pchModuleTooltip = "Filter V matrix of YUV frame";
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_ONE_FRAME;
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_NOTHING;
|
||||
m_bApplyWhilePlaying = !APPLY_WHILE_PLAYING;
|
||||
}
|
||||
|
||||
Void FilterComponentChromaV::create( PlaYUVerFrame* InputFrame )
|
||||
|
||||
@@ -35,8 +35,7 @@ FrameBinarization::FrameBinarization()
|
||||
m_pchModuleName = "FrameBinarization";
|
||||
m_pchModuleTooltip = "Binarize frame";
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_ONE_FRAME;
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_NOTHING;
|
||||
m_bApplyWhilePlaying = APPLY_WHILE_PLAYING;
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_OPTIONS;
|
||||
|
||||
m_cModuleOptions.addOptions()/**/
|
||||
( "threshold", m_uiThreshold, "Threshold level for binarization (0-255) [128]" );
|
||||
|
||||
@@ -37,7 +37,6 @@ FrameDifference::FrameDifference()
|
||||
m_pchModuleTooltip = "Measure the difference between two images (Y plane), Y1 - Y2, with max absolute diff of 128";
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_NEW_WINDOW;
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_TWO_FRAMES;
|
||||
m_bApplyWhilePlaying = APPLY_WHILE_PLAYING;
|
||||
|
||||
m_pcFrameDifference = NULL;
|
||||
}
|
||||
|
||||
+10
-8
@@ -30,13 +30,14 @@ namespace plaYUVer
|
||||
LumaAverage::LumaAverage()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleType = FRAME_MEASUREMENT_MODULE;
|
||||
m_pchModuleCategory = "Measurements";
|
||||
m_pchModuleName = "LumaAverage";
|
||||
m_pchModuleTooltip = "Measure the average of luma component";
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_ONE_FRAME;
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_SIDEBAR;
|
||||
m_bApplyWhilePlaying = APPLY_WHILE_PLAYING;
|
||||
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 )
|
||||
@@ -61,5 +62,6 @@ Void LumaAverage::destroy()
|
||||
|
||||
}
|
||||
|
||||
} // NAMESPACE
|
||||
}
|
||||
// NAMESPACE
|
||||
|
||||
+43
-29
@@ -38,7 +38,7 @@ public: \
|
||||
static PlaYUVerModuleIf* Create() { return new X(); } \
|
||||
void Delete() { delete this; }
|
||||
|
||||
enum // Module type
|
||||
enum // Module type
|
||||
{
|
||||
FRAME_PROCESSING_MODULE,
|
||||
FRAME_MEASUREMENT_MODULE,
|
||||
@@ -47,32 +47,21 @@ enum // Module type
|
||||
#define APPLY_WHILE_PLAYING true
|
||||
#define MAX_NUMBER_FRAMES 3
|
||||
|
||||
enum // Number of frames
|
||||
enum Module_NumberOfFrames
|
||||
{
|
||||
MODULE_REQUIRES_ONE_FRAME = 1,
|
||||
MODULE_REQUIRES_TWO_FRAMES = 2,
|
||||
MODULE_REQUIRES_THREE_FRAMES = 3,
|
||||
};
|
||||
|
||||
enum // Requirements
|
||||
enum Module_Requirements
|
||||
{
|
||||
MODULE_REQUIRES_NOTHING = 0,
|
||||
MODULE_REQUIRES_NEW_WINDOW = 2,
|
||||
MODULE_REQUIRES_SIDEBAR = 4,
|
||||
MODULES_REQUIREMENTS_TOTAL,
|
||||
MODULE_REQUIRES_SKIP_WHILE_PLAY = 2,
|
||||
MODULE_REQUIRES_OPTIONS = 4,
|
||||
MODULE_REQUIRES_NEW_WINDOW = 6,
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Int m_iModuleType;
|
||||
const Char* m_pchModuleCategory;
|
||||
const Char* m_pchModuleName;
|
||||
const Char* m_pchModuleTooltip;
|
||||
UInt m_uiNumberOfFrames;
|
||||
UInt m_uiModuleRequirements;
|
||||
Bool m_bApplyWhilePlaying;
|
||||
} PlaYUVerModuleDefinition;
|
||||
|
||||
class PlaYUVerModuleIf
|
||||
{
|
||||
public:
|
||||
@@ -81,27 +70,52 @@ public:
|
||||
const Char* m_pchModuleCategory;
|
||||
const Char* m_pchModuleName;
|
||||
const Char* m_pchModuleTooltip;
|
||||
UInt m_uiNumberOfFrames;
|
||||
enum Module_NumberOfFrames m_uiNumberOfFrames;
|
||||
UInt m_uiModuleRequirements;
|
||||
Bool m_bApplyWhilePlaying;
|
||||
|
||||
Options m_cModuleOptions;
|
||||
|
||||
PlaYUVerModuleIf() {}
|
||||
virtual ~PlaYUVerModuleIf() {}
|
||||
PlaYUVerModuleIf()
|
||||
{
|
||||
}
|
||||
virtual ~PlaYUVerModuleIf()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void Delete() = 0;
|
||||
|
||||
virtual Void create() {}
|
||||
virtual Void create( PlaYUVerFrame* ) {}
|
||||
virtual Void create()
|
||||
{
|
||||
}
|
||||
virtual Void create( PlaYUVerFrame* )
|
||||
{
|
||||
}
|
||||
|
||||
virtual PlaYUVerFrame* process( PlaYUVerFrame* ) { return NULL; }
|
||||
virtual PlaYUVerFrame* process( PlaYUVerFrame*, PlaYUVerFrame* ) { return NULL; }
|
||||
virtual PlaYUVerFrame* process( PlaYUVerFrame*, PlaYUVerFrame*, PlaYUVerFrame* ) { return NULL; }
|
||||
virtual PlaYUVerFrame* process( PlaYUVerFrame* )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
virtual PlaYUVerFrame* process( PlaYUVerFrame*, PlaYUVerFrame* )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
virtual PlaYUVerFrame* process( PlaYUVerFrame*, PlaYUVerFrame*, PlaYUVerFrame* )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
virtual Double measure( PlaYUVerFrame* ) { return 0; }
|
||||
virtual Double measure( PlaYUVerFrame*, PlaYUVerFrame* ) { return 0; }
|
||||
virtual Double measure( PlaYUVerFrame*, PlaYUVerFrame*, PlaYUVerFrame* ) { return 0; }
|
||||
virtual Double measure( PlaYUVerFrame* )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
virtual Double measure( PlaYUVerFrame*, PlaYUVerFrame* )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
virtual Double measure( PlaYUVerFrame*, PlaYUVerFrame*, PlaYUVerFrame* )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual Void destroy() = 0;
|
||||
|
||||
|
||||
Reference in new issue
Block a user