Improvements on CalypModuleIf
Add type safe flags Replace MACRO with templates (WIP)
This commit is contained in:
43 files changed
+209
-183
No files matched your search
@@ -29,19 +29,19 @@ AbsoluteFrameDifference::AbsoluteFrameDifference()
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2; // Use API version 2 (recommended).
|
||||
// See this example for details on the functions prototype
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE; // Apply module to the frames or to
|
||||
m_iModuleType = ClpModuleType::FrameProcessing; // Apply module to the frames or to
|
||||
// the whole sequence.
|
||||
m_pchModuleCategory = "Measurements"; // Category (sub-menu)
|
||||
m_pchModuleName = "AbsoluteFrameDifference"; // Name (no spaces)
|
||||
m_pchModuleLongName = "Absolute Difference"; // Long Name
|
||||
m_pchModuleTooltip = "Measure the absolute difference " // Description
|
||||
"between two images (Y plane), e. g., abs( Y1 - Y2 )";
|
||||
m_uiNumberOfFrames = 2; // Number of frames required
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_NEW_WINDOW; // Module requirements
|
||||
// (check
|
||||
// CalypModulesIf.h).
|
||||
m_uiNumberOfFrames = 2; // Number of frames required
|
||||
m_uiModuleRequirements = ClpModuleFeature::NewWindow; // Module requirements
|
||||
// (check
|
||||
// CalypModulesIf.h).
|
||||
// Several requirements should be "or" between each others.
|
||||
m_pcFrameDifference = NULL;
|
||||
m_pcFrameDifference = nullptr;
|
||||
}
|
||||
|
||||
bool AbsoluteFrameDifference::create( std::vector<CalypFrame*> apcFrameList )
|
||||
@@ -52,7 +52,7 @@ bool AbsoluteFrameDifference::create( std::vector<CalypFrame*> apcFrameList )
|
||||
if( !apcFrameList[i]->haveSameFmt( apcFrameList[0], CalypFrame::MATCH_COLOR_SPACE_IGNORE_GRAY | CalypFrame::MATCH_COLOR_SPACE | CalypFrame::MATCH_RESOLUTION | CalypFrame::MATCH_BITS ) )
|
||||
return false;
|
||||
|
||||
m_pcFrameDifference = new CalypFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), CLP_GRAY, apcFrameList[0]->getBitsPel() );
|
||||
m_pcFrameDifference = std::make_unique<CalypFrame>( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), CLP_GRAY, apcFrameList[0]->getBitsPel() );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -77,12 +77,5 @@ CalypFrame* AbsoluteFrameDifference::process( std::vector<CalypFrame*> apcFrameL
|
||||
}
|
||||
}
|
||||
}
|
||||
return m_pcFrameDifference;
|
||||
}
|
||||
|
||||
void AbsoluteFrameDifference::destroy()
|
||||
{
|
||||
if( m_pcFrameDifference )
|
||||
delete m_pcFrameDifference;
|
||||
m_pcFrameDifference = NULL;
|
||||
return m_pcFrameDifference.get();
|
||||
}
|
||||
@@ -28,19 +28,16 @@
|
||||
// CalypLib
|
||||
#include "lib/CalypModuleIf.h"
|
||||
|
||||
class AbsoluteFrameDifference : public CalypModuleIf
|
||||
class AbsoluteFrameDifference : public CalypModuleIf,
|
||||
public CalypModuleInstace<AbsoluteFrameDifference>
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( AbsoluteFrameDifference )
|
||||
|
||||
private:
|
||||
CalypFrame* m_pcFrameDifference;
|
||||
std::unique_ptr<CalypFrame> m_pcFrameDifference;
|
||||
|
||||
public:
|
||||
AbsoluteFrameDifference();
|
||||
virtual ~AbsoluteFrameDifference() {}
|
||||
bool create( std::vector<CalypFrame*> apcFrameList );
|
||||
CalypFrame* process( std::vector<CalypFrame*> apcFrameList );
|
||||
void destroy();
|
||||
};
|
||||
|
||||
#endif // __FRAMEDIFFERENCE_H__
|
||||
@@ -29,14 +29,14 @@ DisparityStereoBM::DisparityStereoBM()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "Stereo";
|
||||
m_pchModuleName = "Disparity-BM";
|
||||
m_pchModuleLongName = "Block macth based disparity";
|
||||
m_pchModuleTooltip = "Measure the disparity between two images using the "
|
||||
"Stereo BM method (OpenCV)";
|
||||
m_uiNumberOfFrames = 2;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_SKIP_WHILE_PLAY | CLP_MODULE_REQUIRES_NEW_WINDOW | CLP_MODULE_REQUIRES_OPTIONS;
|
||||
m_uiModuleRequirements = ClpModuleFeature::SkipWhilePlaying | ClpModuleFeature::NewWindow | ClpModuleFeature::Options;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "block_size", m_uiBlockSize, "Block Size (positive odd number) [9]" );
|
||||
|
||||
@@ -29,14 +29,14 @@ DisparityStereoSGBM::DisparityStereoSGBM()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "Stereo";
|
||||
m_pchModuleName = "Disparity-SGBM";
|
||||
m_pchModuleLongName = "SGBM based disparity";
|
||||
m_pchModuleTooltip = "Measure the disparity between two images using the "
|
||||
"Stereo SGBM method (OpenCV)";
|
||||
m_uiNumberOfFrames = 2;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_SKIP_WHILE_PLAY | CLP_MODULE_REQUIRES_NEW_WINDOW | CLP_MODULE_REQUIRES_OPTIONS;
|
||||
m_uiModuleRequirements = ClpModuleFeature::SkipWhilePlaying | ClpModuleFeature::NewWindow | ClpModuleFeature::Options;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "block_size", m_uiBlockSize, "Block Size (positive odd number) [3]" )( "HHAlgorithm", m_bUseHH,
|
||||
|
||||
@@ -28,13 +28,13 @@ EightBitsSampling::EightBitsSampling()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "Conversions";
|
||||
m_pchModuleName = "BitsResampling";
|
||||
m_pchModuleLongName = "Re-sampling frame (bpp)";
|
||||
m_pchModuleTooltip = "Re-sampling frame to a different value of bits per pixel";
|
||||
m_uiNumberOfFrames = 1;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_OPTIONS;
|
||||
m_uiModuleRequirements = ClpModuleFeature::Options;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "num_bits", m_iNumberOfBits, "Number of bits/pixel (8-16) [8]" );
|
||||
|
||||
@@ -30,9 +30,9 @@ FilterComponentModule::FilterComponentModule()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_uiNumberOfFrames = 1;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_NOTHING;
|
||||
m_uiModuleRequirements = ClpModuleFeature::None;
|
||||
m_pchModuleCategory = "Filtering";
|
||||
|
||||
m_pcFilteredFrame = NULL;
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
FrameBinarization::FrameBinarization()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "Utilities";
|
||||
m_pchModuleLongName = "Binarization";
|
||||
m_pchModuleName = "FrameBinarization";
|
||||
m_pchModuleTooltip = "Binarize frame";
|
||||
m_uiNumberOfFrames = 1;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_OPTIONS;
|
||||
m_uiModuleRequirements = ClpModuleFeature::Options;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "threshold", m_uiThreshold, "Threshold level for binarization (0-255) [128]" );
|
||||
|
||||
@@ -28,13 +28,13 @@ FrameConcatenation::FrameConcatenation()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "Utilities";
|
||||
m_pchModuleLongName = "Frame Concatenation";
|
||||
m_pchModuleName = "FrameConc";
|
||||
m_pchModuleTooltip = "Concatenate frames side-by-side";
|
||||
m_uiNumberOfFrames = 2;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_OPTIONS | CLP_MODULE_REQUIRES_NEW_WINDOW;
|
||||
m_uiModuleRequirements = ClpModuleFeature::Options | ClpModuleFeature::NewWindow;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "ShiftHorizontal", m_iShiftHor, "Amount of pixels to shift in horizontal direction" );
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
FrameCrop::FrameCrop()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "Utilities";
|
||||
m_pchModuleLongName = "Crop";
|
||||
m_pchModuleName = "FrameCrop";
|
||||
m_pchModuleTooltip = "Crop a region of a frame";
|
||||
m_uiNumberOfFrames = 1;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_OPTIONS;
|
||||
m_uiModuleRequirements = ClpModuleFeature::Options;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "xPosition", m_uiXPosition, "X cordinate of the left-top corner of the crop region [0]" ) /**/
|
||||
|
||||
@@ -28,13 +28,13 @@ FrameDifference::FrameDifference()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "Measurements";
|
||||
m_pchModuleName = "FrameDifference";
|
||||
m_pchModuleLongName = "Difference";
|
||||
m_pchModuleTooltip = "Measure the difference between two images (Y plane), "
|
||||
"Y1 - Y2, with max absolute diff of 128";
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_NEW_WINDOW | CLP_MODULE_REQUIRES_OPTIONS;
|
||||
m_uiModuleRequirements = ClpModuleFeature::NewWindow | ClpModuleFeature::Options;
|
||||
m_uiNumberOfFrames = 2;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
|
||||
@@ -28,13 +28,13 @@ FrameMask::FrameMask()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "Utilities";
|
||||
m_pchModuleLongName = "Apply mask";
|
||||
m_pchModuleName = "FrameMask";
|
||||
m_pchModuleTooltip = "Applies a mask to the selected image (first image)";
|
||||
m_uiNumberOfFrames = 2;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_NEW_WINDOW | CLP_MODULE_REQUIRES_OPTIONS | CLP_MODULE_USES_KEYS;
|
||||
m_uiModuleRequirements = ClpModuleFeature::NewWindow | ClpModuleFeature::Options | ClpModuleFeature::KeysShortcuts;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "MaskWeigth", m_iWeight, "Influence of the mask [60%]" );
|
||||
|
||||
@@ -37,13 +37,13 @@ FrameResampling::FrameResampling()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "Utilities";
|
||||
m_pchModuleName = "FrameResampling";
|
||||
m_pchModuleLongName = "Frame Resampling (Spatial)";
|
||||
m_pchModuleTooltip = "Resampling frame to an abritary resolution";
|
||||
m_uiNumberOfFrames = 1;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_OPTIONS;
|
||||
m_uiModuleRequirements = ClpModuleFeature::Options;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "width", m_iWidth, "Width of the crop region [-1]" ) /**/
|
||||
|
||||
@@ -28,13 +28,13 @@ FrameRotate::FrameRotate()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "Utilities";
|
||||
m_pchModuleLongName = "Rotation";
|
||||
m_pchModuleName = "FrameRotate";
|
||||
m_pchModuleTooltip = "Rotates frame";
|
||||
m_uiNumberOfFrames = 1;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_OPTIONS;
|
||||
m_uiModuleRequirements = ClpModuleFeature::Options;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "Angle", m_iAngle, "Angle to rotate (0, 90, 180, 270)" );
|
||||
|
||||
@@ -30,13 +30,13 @@ FrameShift::FrameShift()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "Utilities";
|
||||
m_pchModuleLongName = "Pixel Shift";
|
||||
m_pchModuleName = "FrameShift";
|
||||
m_pchModuleTooltip = "Shift frame horizontal and vertical";
|
||||
m_uiNumberOfFrames = 1;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_OPTIONS | CLP_MODULE_USES_KEYS;
|
||||
m_uiModuleRequirements = ClpModuleFeature::Options | ClpModuleFeature::KeysShortcuts;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "ShiftHorizontal", m_iShiftHor, "Amount of pixels to shift in horizontal direction" ) /**/
|
||||
|
||||
@@ -30,16 +30,16 @@ HEVCIntraPrediction::HEVCIntraPrediction()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "HEVC";
|
||||
m_pchModuleLongName = "Intra Prediction";
|
||||
m_pchModuleName = "HEVCIntraPrediction";
|
||||
m_pchModuleTooltip = "Apply intra-frame prediction";
|
||||
m_uiNumberOfFrames = 1;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_NEW_WINDOW |
|
||||
CLP_MODULE_USES_KEYS |
|
||||
CLP_MODULES_HAS_INFO |
|
||||
CLP_MODULE_REQUIRES_OPTIONS;
|
||||
m_uiModuleRequirements = ClpModuleFeature::NewWindow |
|
||||
ClpModuleFeature::KeysShortcuts |
|
||||
ClpModuleFeature::HasInfo |
|
||||
ClpModuleFeature::Options;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "mode", m_uiMode, "Intra mode (26-34) [26]" ) /**/
|
||||
|
||||
@@ -29,15 +29,15 @@ InterFrameVariance::InterFrameVariance()
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2; // Use API version 2 (recommended).
|
||||
// See this example for details on the functions prototype
|
||||
m_iModuleType = CLP_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 = ClpModuleType::FrameProcessing; // Apply module to the frames or to
|
||||
// the whole sequence.
|
||||
m_pchModuleCategory = "Measurements"; // Category (sub-menu)
|
||||
m_pchModuleName = "InterFrameVariance"; // Name
|
||||
m_pchModuleLongName = "Variance across frames";
|
||||
m_pchModuleTooltip = "Measure the variance across several frames";
|
||||
m_uiNumberOfFrames = 2; // Number of Frames required (This module
|
||||
// allows a variable number of inputs)
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_NEW_WINDOW | CLP_MODULES_VARIABLE_NUM_FRAMES;
|
||||
m_uiModuleRequirements = ClpModuleFeature::NewWindow | ClpModuleFeature::VariableNumOfFrames;
|
||||
// Several requirements should be "or" between each others.
|
||||
m_pcFrameVariance = NULL;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
LumaAverage::LumaAverage()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleType = CLP_FRAME_MEASUREMENT_MODULE; // Apply module to the frames or to
|
||||
m_iModuleType = ClpModuleType::FrameMeasurement; // Apply module to the frames or to
|
||||
// the whole sequence.
|
||||
// Currently only support for frame
|
||||
m_pchModuleCategory = "Measurements"; // Category (sub-menu)
|
||||
@@ -37,7 +37,7 @@ LumaAverage::LumaAverage()
|
||||
m_uiNumberOfFrames = 1; // Number of Frames required
|
||||
// (ONE_FRAME, TWO_FRAMES,
|
||||
// THREE_FRAMES)
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_NOTHING; // Module requirements
|
||||
m_uiModuleRequirements = ClpModuleFeature::None; // Module requirements
|
||||
// (check
|
||||
// CalypModulesIf.h).
|
||||
// Several requirements should be "or" between each others.
|
||||
|
||||
@@ -38,13 +38,13 @@ MeasureOpticalFlowDualTVL1::MeasureOpticalFlowDualTVL1()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "Measurements";
|
||||
m_pchModuleName = "MeasureOpticalFlowDualTVL1";
|
||||
m_pchModuleLongName = "Optical flow based on DualTVL1";
|
||||
m_pchModuleTooltip = "Measure optical flow";
|
||||
m_uiNumberOfFrames = 2;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_SKIP_WHILE_PLAY | CLP_MODULE_REQUIRES_NEW_WINDOW | CLP_MODULE_REQUIRES_OPTIONS;
|
||||
m_uiModuleRequirements = ClpModuleFeature::SkipWhilePlaying | ClpModuleFeature::NewWindow | ClpModuleFeature::Options;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "Show reconstruction", m_bShowReconstruction, "Show reconstructed frame instead of MVs [false]" );
|
||||
|
||||
@@ -39,10 +39,10 @@ OpticalFlowModule::OpticalFlowModule()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "OpticalFlow";
|
||||
m_uiNumberOfFrames = 2;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_SKIP_WHILE_PLAY | CLP_MODULE_REQUIRES_NEW_WINDOW | CLP_MODULE_REQUIRES_OPTIONS;
|
||||
m_uiModuleRequirements = ClpModuleFeature::SkipWhilePlaying | ClpModuleFeature::NewWindow | ClpModuleFeature::Options;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "Show reconstruction", m_bShowReconstruction, "Show reconstructed frame instead of MVs [false]" );
|
||||
|
||||
@@ -32,18 +32,18 @@ OptimiseDisplay::OptimiseDisplay()
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2; // Use API version 2 (recommended).
|
||||
// See this example for details on the functions prototype
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE; // Apply module to the frames or to
|
||||
m_iModuleType = ClpModuleType::FrameProcessing; // Apply module to the frames or to
|
||||
// the whole sequence.
|
||||
m_pchModuleCategory = "Conversions"; // Category (sub-menu)
|
||||
m_pchModuleName = "OptimiseDisplay"; // Name (no spaces)
|
||||
m_pchModuleLongName = "Optimise Display"; // Long Name
|
||||
m_pchModuleTooltip = "Scales the display of images " // Description
|
||||
"for better visualization of small differences";
|
||||
m_uiNumberOfFrames = 1; // Number of frames required
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_NOTHING; // Module requirements
|
||||
// (check
|
||||
// CalypModulesIf.h).
|
||||
// Several requirements should be "or" between each others.
|
||||
m_uiNumberOfFrames = 1; // Number of frames required
|
||||
m_uiModuleRequirements = ClpModuleFeature::None; // Module requirements
|
||||
// (check
|
||||
// CalypModulesIf.h).
|
||||
// Several requirements should be "or" between each others.
|
||||
m_pcOptimisedFrame = nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,12 +33,12 @@ SaliencyBasedFiltering::SaliencyBasedFiltering()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "Quality";
|
||||
m_pchModuleName = "SaliencyBasedFiltering";
|
||||
m_pchModuleLongName = "Saliency Based Filtering";
|
||||
m_pchModuleTooltip = "Image filter based on a map";
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_NOTHING;
|
||||
m_uiModuleRequirements = ClpModuleFeature::None;
|
||||
m_uiNumberOfFrames = 2;
|
||||
|
||||
m_pcProcessedFrame = NULL;
|
||||
|
||||
@@ -36,17 +36,13 @@ SaliencyDetectionModule::SaliencyDetectionModule()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "Saliency";
|
||||
m_uiNumberOfFrames = 1;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_NEW_WINDOW;
|
||||
m_uiModuleRequirements = ClpModuleFeature::NewWindow;
|
||||
m_bConvertToGray = true;
|
||||
}
|
||||
|
||||
void SaliencyDetectionModule::destroy_using_opencv()
|
||||
{
|
||||
}
|
||||
|
||||
SaliencyDetectionSpectral::SaliencyDetectionSpectral()
|
||||
{
|
||||
/* Module Definition */
|
||||
@@ -54,7 +50,7 @@ SaliencyDetectionSpectral::SaliencyDetectionSpectral()
|
||||
m_pchModuleLongName = "Spectral residual";
|
||||
m_pchModuleTooltip = "Measure saliency using spectral residual method";
|
||||
|
||||
m_uiModuleRequirements = m_uiModuleRequirements | CLP_MODULE_REQUIRES_OPTIONS;
|
||||
m_uiModuleRequirements = m_uiModuleRequirements | ClpModuleFeature::Options;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "Binary map", m_bBinaryMap, "Measure a binary saliency map [false]" );
|
||||
|
||||
@@ -51,7 +51,6 @@ protected:
|
||||
public:
|
||||
SaliencyDetectionModule();
|
||||
virtual ~SaliencyDetectionModule() {}
|
||||
void destroy_using_opencv();
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -66,11 +65,11 @@ public:
|
||||
* approach. In Computer Vision and Pattern Recognition, 2007.
|
||||
* CVPR'07. IEEE Conference on, pages 1–8. IEEE, 2007.
|
||||
*/
|
||||
class SaliencyDetectionSpectral : public SaliencyDetectionModule
|
||||
class SaliencyDetectionSpectral : public SaliencyDetectionModule,
|
||||
public CalypModuleInstace<SaliencyDetectionSpectral>
|
||||
{
|
||||
using Mat = cv::Mat;
|
||||
|
||||
REGISTER_CLASS_FACTORY( SaliencyDetectionSpectral )
|
||||
private:
|
||||
bool m_bBinaryMap;
|
||||
|
||||
@@ -91,11 +90,11 @@ public:
|
||||
* platform and novel features derived from a visual saliency mechanism.
|
||||
* In Image and Vision Computing, Vol. 28 Issue 3, pages 391–402. Elsevier, 2010.
|
||||
*/
|
||||
class SaliencyDetectionFineGrained : public SaliencyDetectionModule
|
||||
class SaliencyDetectionFineGrained : public SaliencyDetectionModule,
|
||||
public CalypModuleInstace<SaliencyDetectionFineGrained>
|
||||
{
|
||||
using Mat = cv::Mat;
|
||||
|
||||
REGISTER_CLASS_FACTORY( SaliencyDetectionFineGrained )
|
||||
public:
|
||||
SaliencyDetectionFineGrained();
|
||||
virtual ~SaliencyDetectionFineGrained() {}
|
||||
@@ -110,11 +109,11 @@ public:
|
||||
* Wang and P. Dudek “A Fast Self-tuning Background Subtraction Algorithm”,
|
||||
* in proc of IEEE Workshop on Change Detection, 2014
|
||||
*/
|
||||
class SaliencyDetectionBinWangApr2014 : public SaliencyDetectionModule
|
||||
class SaliencyDetectionBinWangApr2014 : public SaliencyDetectionModule,
|
||||
public CalypModuleInstace<SaliencyDetectionBinWangApr2014>
|
||||
{
|
||||
using Mat = cv::Mat;
|
||||
|
||||
REGISTER_CLASS_FACTORY( SaliencyDetectionBinWangApr2014 )
|
||||
public:
|
||||
SaliencyDetectionBinWangApr2014();
|
||||
virtual ~SaliencyDetectionBinWangApr2014() {}
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
SetChromaHalfScale::SetChromaHalfScale()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "Conversions";
|
||||
m_pchModuleName = "SetChromaHalfScale";
|
||||
m_pchModuleLongName = "Half scale chroma";
|
||||
m_pchModuleTooltip = "Copy frame only keeping luma component";
|
||||
m_uiNumberOfFrames = 1;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_NOTHING;
|
||||
m_uiModuleRequirements = ClpModuleFeature::None;
|
||||
|
||||
m_pcProcessedFrame = NULL;
|
||||
}
|
||||
|
||||
@@ -39,16 +39,16 @@ ThreeSixtyDownsampling::ThreeSixtyDownsampling()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "360Video";
|
||||
m_pchModuleName = "ThreeSixtyDownsampling";
|
||||
m_pchModuleLongName = "Adaptive Latitude Downsampling";
|
||||
m_pchModuleTooltip = "Adaptive Latitude Downsampling";
|
||||
m_uiNumberOfFrames = 1;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_SKIP_WHILE_PLAY |
|
||||
CLP_MODULE_REQUIRES_OPTIONS |
|
||||
CLP_MODULES_HAS_INFO |
|
||||
CLP_MODULE_USES_KEYS;
|
||||
m_uiModuleRequirements = ClpModuleFeature::SkipWhilePlaying |
|
||||
ClpModuleFeature::Options |
|
||||
ClpModuleFeature::HasInfo |
|
||||
ClpModuleFeature::KeysShortcuts;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "Downsampling", m_uiDownsampling, "ERP to NxN (0 for up, 1 for down and 2 for recon) [1]" ) /**/
|
||||
|
||||
@@ -37,13 +37,13 @@ ThreeSixtyDynamicDownsampling::ThreeSixtyDynamicDownsampling()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "360Video";
|
||||
m_pchModuleLongName = "Dynamic Downsampling";
|
||||
m_pchModuleName = "ThreeSixtyDynamicDownsampling";
|
||||
m_pchModuleTooltip = "Dynamic downsampling of 360 videos";
|
||||
m_uiNumberOfFrames = 1;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_SKIP_WHILE_PLAY | CLP_MODULE_REQUIRES_OPTIONS;
|
||||
m_uiModuleRequirements = ClpModuleFeature::SkipWhilePlaying | ClpModuleFeature::Options;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "CodingFaceWidth", m_uiFaceWidth, "Coding Face Width [same as input]" ) /**/
|
||||
|
||||
@@ -37,15 +37,15 @@ ThreeSixtyFaceConcatenation::ThreeSixtyFaceConcatenation()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "360Video";
|
||||
m_pchModuleLongName = "Face Concatenation";
|
||||
m_pchModuleName = "ThreeSixtyFaceConcatenation";
|
||||
m_pchModuleTooltip = "Concatenate 360 video faces";
|
||||
m_uiNumberOfFrames = 1;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_SKIP_WHILE_PLAY |
|
||||
CLP_MODULE_REQUIRES_OPTIONS |
|
||||
CLP_MODULES_VARIABLE_NUM_FRAMES;
|
||||
m_uiModuleRequirements = ClpModuleFeature::SkipWhilePlaying |
|
||||
ClpModuleFeature::Options |
|
||||
ClpModuleFeature::VariableNumOfFrames;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "projection", m_uiProjectionType, "Projection [1] \n 1: Cubemap (6 faces)" ) /**/
|
||||
|
||||
@@ -37,13 +37,13 @@ ThreeSixtyFaceExtraction::ThreeSixtyFaceExtraction()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "360Video";
|
||||
m_pchModuleLongName = "Face Extration";
|
||||
m_pchModuleName = "ThreeSixtyFaceExtration";
|
||||
m_pchModuleTooltip = "Extract a 360 video face";
|
||||
m_uiNumberOfFrames = 1;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_SKIP_WHILE_PLAY;
|
||||
m_uiModuleRequirements = ClpModuleFeature::SkipWhilePlaying;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "faceNum", m_uiFaceNum, "360 proejction face to be outputed [0]" ) /**/
|
||||
|
||||
@@ -37,14 +37,14 @@ ThreeSixtyNxN::ThreeSixtyNxN()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "360Video";
|
||||
m_pchModuleName = "ThreeSixtyNxN";
|
||||
m_pchModuleLongName = "ERP to NxN";
|
||||
m_pchModuleTooltip = "Downsampling ERP to NxN";
|
||||
m_uiNumberOfFrames = 1;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_SKIP_WHILE_PLAY |
|
||||
CLP_MODULE_REQUIRES_OPTIONS;
|
||||
m_uiModuleRequirements = ClpModuleFeature::SkipWhilePlaying |
|
||||
ClpModuleFeature::Options;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "Downsampling", m_uiDownsampling, "ERP to NxN (0 for up, 1 for down and 2 for recon) [1]" ) /**/
|
||||
|
||||
@@ -28,13 +28,13 @@ ThreeSixtySpatialtoTemporal::ThreeSixtySpatialtoTemporal()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_3;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameProcessing;
|
||||
m_pchModuleCategory = "360Video";
|
||||
m_pchModuleLongName = "Spatial to Temporal";
|
||||
m_pchModuleName = "ThreeSixtySpatialtoTemporal";
|
||||
m_pchModuleTooltip = "Convert 360 video from Cube Map Projection to temporal frames";
|
||||
m_uiNumberOfFrames = 1;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_SKIP_WHILE_PLAY | CLP_MODULE_REQUIRES_OPTIONS;
|
||||
m_uiModuleRequirements = ClpModuleFeature::SkipWhilePlaying | ClpModuleFeature::Options;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "spa2temp", m_uiSpatial2Temporal, "Convert from spatial to temporal [1]" ) /**/
|
||||
|
||||
@@ -30,12 +30,12 @@ WeightedPSNR::WeightedPSNR()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2;
|
||||
m_iModuleType = CLP_FRAME_MEASUREMENT_MODULE;
|
||||
m_iModuleType = ClpModuleType::FrameMeasurement;
|
||||
m_pchModuleCategory = "Quality";
|
||||
m_pchModuleName = "WeightedPSNR";
|
||||
m_pchModuleLongName = "Weighted PSNR";
|
||||
m_pchModuleTooltip = "Measure the weighted PSNR between two images";
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_OPTIONS;
|
||||
m_uiModuleRequirements = ClpModuleFeature::Options;
|
||||
m_uiNumberOfFrames = 3;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
|
||||
@@ -89,7 +89,7 @@ TEST_F( TestModuleCreate, FIND_MODULE )
|
||||
TEST_F( TestModuleCreate, CREATE_OK )
|
||||
{
|
||||
bool moduleRequireOptions = false;
|
||||
if( pcModule->m_uiModuleRequirements & CLP_MODULE_REQUIRES_OPTIONS )
|
||||
if( pcModule->m_uiModuleRequirements & ClpModuleFeature::Options )
|
||||
{
|
||||
moduleRequireOptions = true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user