Re-format code

This commit is contained in:
jfmcarreira committed 2017-03-23 04:29:34 +00:00
1 parent fd68d340bd
commit ebc10d1b84
85 files changed
+8092 -4419

No files matched your search

+13 -8
View File
@@ -27,17 +27,22 @@
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_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_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;
}
@@ -51,8 +56,8 @@ Bool AbsoluteFrameDifference::create( std::vector<PlaYUVerFrame*> apcFrameList )
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;
}
+9 -5
View File
@@ -19,7 +19,8 @@
/**
* \file DisparityStereoBM.cpp
* \brief Measure the disparity between two images using the Stereo Var method (OpenCV)
* \brief Measure the disparity between two images using the Stereo Var
* method (OpenCV)
*/
#include "DisparityStereoBM.h"
@@ -31,9 +32,12 @@ DisparityStereoBM::DisparityStereoBM()
m_iModuleType = FRAME_PROCESSING_MODULE;
m_pchModuleCategory = "Stereo";
m_pchModuleName = "Disparity-BM";
m_pchModuleTooltip = "Measure the disparity between two images using the Stereo BM method (OpenCV)";
m_pchModuleTooltip =
"Measure the disparity between two images using the "
"Stereo BM method (OpenCV)";
m_uiNumberOfFrames = MODULE_REQUIRES_TWO_FRAMES;
m_uiModuleRequirements = MODULE_REQUIRES_SKIP_WHILE_PLAY | MODULE_REQUIRES_NEW_WINDOW | MODULE_REQUIRES_OPTIONS;
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]" );
@@ -45,8 +49,8 @@ DisparityStereoBM::DisparityStereoBM()
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++;
+2 -1
View File
@@ -19,7 +19,8 @@
/**
* \file DisparityStereoBM.h
* \brief Measure the disparity between two images using the Stereo Var method (OpenCV)
* \brief Measure the disparity between two images using the Stereo Var
* method (OpenCV)
*/
#ifndef __DISPARITYSTEREOBM_H__
+13 -8
View File
@@ -19,7 +19,8 @@
/**
* \file DisparityStereoSGBM.cpp
* \brief Measure the disparity between two images using the SGBM method (OpenCV)
* \brief Measure the disparity between two images using the SGBM method
* (OpenCV)
*/
#include "DisparityStereoSGBM.h"
@@ -31,13 +32,16 @@ DisparityStereoSGBM::DisparityStereoSGBM()
m_iModuleType = FRAME_PROCESSING_MODULE;
m_pchModuleCategory = "Stereo";
m_pchModuleName = "Disparity-SGBM";
m_pchModuleTooltip = "Measure the disparity between two images using the Stereo SGBM method (OpenCV)";
m_pchModuleTooltip =
"Measure the disparity between two images using the "
"Stereo SGBM method (OpenCV)";
m_uiNumberOfFrames = MODULE_REQUIRES_TWO_FRAMES;
m_uiModuleRequirements = MODULE_REQUIRES_SKIP_WHILE_PLAY | MODULE_REQUIRES_NEW_WINDOW | MODULE_REQUIRES_OPTIONS;
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]" );
( "block_size", m_uiBlockSize, "Block Size (positive odd number) [3]" )(
"HHAlgorithm", m_bUseHH, "Use HH algorithm [false]" );
m_pcDisparityFrame = NULL;
m_uiBlockSize = 3;
@@ -47,8 +51,8 @@ DisparityStereoSGBM::DisparityStereoSGBM()
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++;
@@ -67,7 +71,8 @@ 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;
+16 -8
View File
@@ -19,18 +19,26 @@
/**
* \file DisparityStereoSGBM.h
* \brief Measure the disparity between two images using the SGBM method (OpenCV)
* \brief Measure the disparity between two images using the SGBM method
* (OpenCV)
* The class implements the modified H. Hirschmuller algorithm
* that differs from the original one as follows:
* - By default, the algorithm is single-pass, which means that you consider only 5 directions
* instead of 8. Set mode=StereoSGBM::MODE_HH in createStereoSGBM to run the full variant of the
* - By default, the algorithm is single-pass, which means that you consider
* only 5 directions
* instead of 8. Set mode=StereoSGBM::MODE_HH in createStereoSGBM to run the
* full variant of the
* algorithm but beware that it may consume a lot of memory.
* - The algorithm matches blocks, not individual pixels. Though, setting blockSize=1 reduces the
* - The algorithm matches blocks, not individual pixels. Though, setting
* blockSize=1 reduces the
* blocks to single pixels.
* - Mutual information cost function is not implemented. Instead, a simpler Birchfield-Tomasi
* sub-pixel metric from @cite BT98 is used. Though, the color images are supported as well.
* - Some pre- and post- processing steps from K. Konolige algorithm StereoBM are included, for
* example: pre-filtering (StereoBM::PREFILTER_XSOBEL type) and post-filtering (uniqueness
* - Mutual information cost function is not implemented. Instead, a simpler
* Birchfield-Tomasi
* sub-pixel metric from @cite BT98 is used. Though, the color images are
* supported as well.
* - Some pre- and post- processing steps from K. Konolige algorithm StereoBM
* are included, for
* example: pre-filtering (StereoBM::PREFILTER_XSOBEL type) and post-filtering
* (uniqueness
* check, quadratic interpolation and speckle filtering).
*/
+9 -6
View File
@@ -19,7 +19,8 @@
/**
* \file DisparityStereoVar.cpp
* \brief Measure the disparity between two images using the Stereo Var method (OpenCV)
* \brief Measure the disparity between two images using the Stereo Var
* method (OpenCV)
*/
#include "DisparityStereoVar.h"
@@ -31,7 +32,9 @@ DisparityStereoVar::DisparityStereoVar()
m_iModuleType = FRAME_PROCESSING_MODULE;
m_pchModuleCategory = "Disparity";
m_pchModuleName = "StereoVar";
m_pchModuleTooltip = "Measure the disparity between two images using the Stereo Var method (OpenCV)";
m_pchModuleTooltip =
"Measure the disparity between two images using the "
"Stereo Var method (OpenCV)";
m_uiNumberOfFrames = MODULE_REQUIRES_TWO_FRAMES;
m_uiModuleRequirements = MODULE_REQUIRES_SKIP_WHILE_PLAY | MODULE_REQUIRES_NEW_WINDOW;
@@ -47,15 +50,15 @@ DisparityStereoVar::DisparityStereoVar()
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.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;
}
+2 -1
View File
@@ -19,7 +19,8 @@
/**
* \file DisparityStereoVar.h
* \brief Measure the disparity between two images using the Stereo Var method (OpenCV)
* \brief Measure the disparity between two images using the Stereo Var
* method (OpenCV)
*/
#ifndef __DISPARITYSTEREOVAR_H__
+3 -2
View File
@@ -43,8 +43,9 @@ 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;
+11 -5
View File
@@ -58,19 +58,25 @@ FilterComponentLuma::FilterComponentLuma()
{
/* Module Definition */
m_iModuleAPI = MODULE_API_2;
m_iModuleType = FRAME_PROCESSING_MODULE; // Apply module to the frames or to the whole sequence.
m_iModuleType = FRAME_PROCESSING_MODULE; // Apply module to the frames or to
// the whole sequence.
// Currently only support for frame
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 )
{
return createFilter( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), apcFrameList[0]->getBitsPel() );
return createFilter( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(),
apcFrameList[0]->getBitsPel() );
}
PlaYUVerFrame* FilterComponentLuma::process( std::vector<PlaYUVerFrame*> apcFrameList )
+8 -5
View File
@@ -34,10 +34,12 @@ 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]" ) /**/
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;
@@ -58,7 +60,8 @@ Void FrameCrop::create( PlaYUVerFrame* frame )
{
m_iYSize = frame->getHeight() - m_uiYPosition;
}
m_pcCropedFrame = new PlaYUVerFrame( m_iXSize, m_iYSize, frame->getPelFormat(), frame->getBitsPel() );
m_pcCropedFrame =
new PlaYUVerFrame( m_iXSize, m_iYSize, frame->getPelFormat(), frame->getBitsPel() );
}
PlaYUVerFrame* FrameCrop::process( PlaYUVerFrame* frame )
+8 -5
View File
@@ -31,7 +31,9 @@ FrameDifference::FrameDifference()
m_iModuleType = FRAME_PROCESSING_MODULE;
m_pchModuleCategory = "Measurements";
m_pchModuleName = "FrameDifference";
m_pchModuleTooltip = "Measure the difference between two images (Y plane), Y1 - Y2, with max absolute diff of 128";
m_pchModuleTooltip =
"Measure the difference between two images (Y plane), "
"Y1 - Y2, with max absolute diff of 128";
m_uiModuleRequirements = MODULE_REQUIRES_NEW_WINDOW | MODULE_REQUIRES_OPTIONS;
m_uiNumberOfFrames = MODULE_REQUIRES_TWO_FRAMES;
@@ -50,8 +52,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,8 +69,9 @@ 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;
}
+5 -5
View File
@@ -49,9 +49,9 @@ 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 ) )
if( !apcFrameList[i]->haveSameFmt(
apcFrameList[0], PlaYUVerFrame::MATCH_COLOR_SPACE_IGNORE_GRAY |
PlaYUVerFrame::MATCH_RESOLUTION | PlaYUVerFrame::MATCH_BITS ) )
{
return false;
}
@@ -79,8 +79,8 @@ Bool FrameMask::create( std::vector<PlaYUVerFrame*> apcFrameList )
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;
}
+4 -2
View File
@@ -58,11 +58,13 @@ PlaYUVerFrame* FrameShift::process( std::vector<PlaYUVerFrame*> apcFrameList )
UInt xStartOut = m_iShiftHor >= 0 ? m_iShiftHor : 0;
UInt xStartIn = m_iShiftHor >= 0 ? 0 : -m_iShiftHor;
UInt xEndOut = m_iShiftHor >= 0 ? m_pcProcessedFrame->getWidth() : m_pcProcessedFrame->getWidth() + m_iShiftHor;
UInt xEndOut = m_iShiftHor >= 0 ? m_pcProcessedFrame->getWidth()
: m_pcProcessedFrame->getWidth() + m_iShiftHor;
UInt yStartOut = m_iShiftVer >= 0 ? m_iShiftVer : 0;
UInt yStartIn = m_iShiftVer >= 0 ? 0 : -m_iShiftVer;
UInt yEndOut = m_iShiftVer >= 0 ? m_pcProcessedFrame->getHeight() : m_pcProcessedFrame->getHeight() + m_iShiftVer;
UInt yEndOut = m_iShiftVer >= 0 ? m_pcProcessedFrame->getHeight()
: m_pcProcessedFrame->getHeight() + m_iShiftVer;
m_pcProcessedFrame->clear();
+9 -6
View File
@@ -30,13 +30,16 @@ InterFrameVariance::InterFrameVariance()
/* 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_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;
}
@@ -53,8 +56,8 @@ Bool InterFrameVariance::create( std::vector<PlaYUVerFrame*> apcFrameList )
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;
+9 -4
View File
@@ -27,14 +27,19 @@
LumaAverage::LumaAverage()
{
/* Module Definition */
m_iModuleType = FRAME_MEASUREMENT_MODULE; // Apply module to the frames or to the whole sequence.
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_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 )
+6 -3
View File
@@ -40,10 +40,12 @@ MeasureOpticalFlowDualTVL1::MeasureOpticalFlowDualTVL1()
m_pchModuleName = "MeasureOpticalFlowDualTVL1";
m_pchModuleTooltip = "Measure optical flow";
m_uiNumberOfFrames = MODULE_REQUIRES_TWO_FRAMES;
m_uiModuleRequirements = MODULE_REQUIRES_SKIP_WHILE_PLAY | MODULE_REQUIRES_NEW_WINDOW | MODULE_REQUIRES_OPTIONS;
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]" );
( "Show reconstruction", m_bShowReconstruction,
"Show reconstructed frame instead of MVs [false]" );
m_bShowReconstruction = false;
m_pcOutputFrame = NULL;
@@ -61,7 +63,8 @@ Bool MeasureOpticalFlowDualTVL1::create( std::vector<PlaYUVerFrame*> apcFrameLis
m_iStep = 16;
m_cTvl1 = cv::createOptFlow_DualTVL1();
m_pcOutputFrame = new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), PlaYUVerFrame::GRAY );
m_pcOutputFrame = new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(),
PlaYUVerFrame::GRAY );
return true;
}
+6 -3
View File
@@ -45,10 +45,12 @@ OpticalFlowModule::OpticalFlowModule()
m_iModuleType = FRAME_PROCESSING_MODULE;
m_pchModuleCategory = "OpticalFlow";
m_uiNumberOfFrames = MODULE_REQUIRES_TWO_FRAMES;
m_uiModuleRequirements = MODULE_REQUIRES_SKIP_WHILE_PLAY | MODULE_REQUIRES_NEW_WINDOW | MODULE_REQUIRES_OPTIONS;
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]" );
( "Show reconstruction", m_bShowReconstruction,
"Show reconstructed frame instead of MVs [false]" );
m_bShowReconstruction = false;
m_pcOutputFrame = NULL;
@@ -65,7 +67,8 @@ Bool OpticalFlowModule::commonCreate( std::vector<PlaYUVerFrame*> apcFrameList )
return false;
m_iStep = 16;
m_pcOutputFrame = new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), PlaYUVerFrame::GRAY );
m_pcOutputFrame = new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(),
PlaYUVerFrame::GRAY );
return true;
}
+2 -2
View File
@@ -22,11 +22,11 @@
* \brief PlaYUVer modules factory
*/
#include "config.h"
#include "PlaYUVerModuleFactory.h"
#include "config.h"
#include <functional>
#include <cstring>
#include <functional>
#ifdef USE_DYNLOAD
#include <dlfcn.h>
#endif
+2 -2
View File
@@ -40,8 +40,8 @@ SetChromaHalfScale::SetChromaHalfScale()
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 )
+2 -1
View File
@@ -57,7 +57,8 @@ Bool WeightedPSNR::create( std::vector<PlaYUVerFrame*> apcFrameList )
}
for( UInt i = 1; i < apcFrameList.size(); i++ )
{
if( !apcFrameList[i]->haveSameFmt( apcFrameList[1], PlaYUVerFrame::MATCH_COLOR_SPACE | PlaYUVerFrame::MATCH_BITS ) )
if( !apcFrameList[i]->haveSameFmt(
apcFrameList[1], PlaYUVerFrame::MATCH_COLOR_SPACE | PlaYUVerFrame::MATCH_BITS ) )
return false;
}
return true;