diff --git a/modules/bioinspired/include/opencv2/bioinspired/retina.hpp b/modules/bioinspired/include/opencv2/bioinspired/retina.hpp index b4fda7038..c9655c4a9 100644 --- a/modules/bioinspired/include/opencv2/bioinspired/retina.hpp +++ b/modules/bioinspired/include/opencv2/bioinspired/retina.hpp @@ -122,7 +122,7 @@ public: horizontalCellsGain(0.01f), hcellsTemporalConstant(0.5f), hcellsSpatialConstant(7.f), - ganglionCellsSensitivity(0.75f){};// default setup + ganglionCellsSensitivity(0.75f) { } // default setup bool colorMode, normaliseOutput; float photoreceptorsLocalAdaptationSensitivity, photoreceptorsTemporalConstant, photoreceptorsSpatialConstant, horizontalCellsGain, hcellsTemporalConstant, hcellsSpatialConstant, ganglionCellsSensitivity; }; @@ -135,7 +135,7 @@ public: amacrinCellsTemporalCutFrequency(2.0f), V0CompressionParameter(0.95f), localAdaptintegration_tau(0.f), - localAdaptintegration_k(7.f){};// default setup + localAdaptintegration_k(7.f) { } // default setup bool normaliseOutput; float parasolCells_beta, parasolCells_tau, parasolCells_k, amacrinCellsTemporalCutFrequency, V0CompressionParameter, localAdaptintegration_tau, localAdaptintegration_k; }; diff --git a/modules/bioinspired/src/basicretinafilter.hpp b/modules/bioinspired/src/basicretinafilter.hpp index 323bff940..4986352bf 100644 --- a/modules/bioinspired/src/basicretinafilter.hpp +++ b/modules/bioinspired/src/basicretinafilter.hpp @@ -137,17 +137,17 @@ namespace bioinspired /** * function which clears the output buffer of the object */ - inline void clearOutputBuffer(){_filterOutput=0;}; + inline void clearOutputBuffer() { _filterOutput = 0; } /** * function which clears the secondary buffer of the object */ - inline void clearSecondaryBuffer(){_localBuffer=0;}; + inline void clearSecondaryBuffer() { _localBuffer = 0; } /** * function which clears the output and the secondary buffer of the object */ - inline void clearAllBuffers(){clearOutputBuffer();clearSecondaryBuffer();}; + inline void clearAllBuffers() { clearOutputBuffer(); clearSecondaryBuffer(); } /** * resize basic retina filter object (resize all allocated buffers @@ -160,7 +160,7 @@ namespace bioinspired * forbiden method inherited from parent std::valarray * prefer not to use this method since the filter matrix become vectors */ - void resize(const unsigned int){std::cerr<<"error, not accessible method"< &inputFrame, const unsigned int filterIndex=0){_spatiotemporalLPfilter_Irregular(&inputFrame[0], filterIndex);}; + inline void runProgressiveFilter(std::valarray &inputFrame, const unsigned int filterIndex=0) { _spatiotemporalLPfilter_Irregular(&inputFrame[0], filterIndex); } /** * run low pass filtering with progressive parameters (models the retina log sampling of the photoreceptors and its low pass filtering effect consequence: more powerfull low pass filtering effect on the corners) @@ -232,7 +232,7 @@ namespace bioinspired inline void runProgressiveFilter(const std::valarray &inputFrame, std::valarray &outputFrame, const unsigned int filterIndex=0) - {_spatiotemporalLPfilter_Irregular(get_data(inputFrame), &outputFrame[0], filterIndex);}; + {_spatiotemporalLPfilter_Irregular(get_data(inputFrame), &outputFrame[0], filterIndex); } /** * first order spatio-temporal low pass filter setup function @@ -268,20 +268,31 @@ namespace bioinspired * @param maxInputValue: the maximum amplitude value measured after local adaptation processing (c.f. function runFilter_LocalAdapdation & runFilter_LocalAdapdation_autonomous) * @param meanLuminance: the a priori meann luminance of the input data (should be 128 for 8bits images but can vary greatly in case of High Dynamic Range Images (HDRI) */ - void setV0CompressionParameter(const float v0, const float maxInputValue, const float){ _v0=v0*maxInputValue; _localLuminanceFactor=v0; _localLuminanceAddon=maxInputValue*(1.0f-v0); _maxInputValue=maxInputValue;}; + void setV0CompressionParameter(const float v0, const float maxInputValue, const float) + { + _v0=v0*maxInputValue; + _localLuminanceFactor=v0; + _localLuminanceAddon=maxInputValue*(1.0f-v0); + _maxInputValue=maxInputValue; + } /** * update local luminance adaptation setup, initial maxInputValue is kept. This function should be applied for normal local adaptation (not for tone mapping operation) * @param v0: compression effect for the local luminance adaptation processing, set a value between 0.6 and 0.9 for best results, a high value yields to a high compression effect * @param meanLuminance: the a priori meann luminance of the input data (should be 128 for 8bits images but can vary greatly in case of High Dynamic Range Images (HDRI) */ - void setV0CompressionParameter(const float v0, const float meanLuminance){ this->setV0CompressionParameter(v0, _maxInputValue, meanLuminance);}; + void setV0CompressionParameter(const float v0, const float meanLuminance) { this->setV0CompressionParameter(v0, _maxInputValue, meanLuminance); } /** * local luminance adaptation setup, this function should be applied for normal local adaptation (not for tone mapping operation) * @param v0: compression effect for the local luminance adaptation processing, set a value between 0.6 and 0.9 for best results, a high value yields to a high compression effect */ - void setV0CompressionParameter(const float v0){ _v0=v0*_maxInputValue; _localLuminanceFactor=v0; _localLuminanceAddon=_maxInputValue*(1.0f-v0);}; + void setV0CompressionParameter(const float v0) + { + _v0=v0*_maxInputValue; + _localLuminanceFactor=v0; + _localLuminanceAddon=_maxInputValue*(1.0f-v0); + } /** * local luminance adaptation setup, this function should be applied for local adaptation applied to tone mapping operation @@ -289,66 +300,76 @@ namespace bioinspired * @param maxInputValue: the maximum amplitude value measured after local adaptation processing (c.f. function runFilter_LocalAdapdation & runFilter_LocalAdapdation_autonomous) * @param meanLuminance: the a priori meann luminance of the input data (should be 128 for 8bits images but can vary greatly in case of High Dynamic Range Images (HDRI) */ - void setV0CompressionParameterToneMapping(const float v0, const float maxInputValue, const float meanLuminance=128.0f){ _v0=v0*maxInputValue; _localLuminanceFactor=1.0f; _localLuminanceAddon=meanLuminance*v0; _maxInputValue=maxInputValue;}; + void setV0CompressionParameterToneMapping(const float v0, const float maxInputValue, const float meanLuminance=128.0f) + { + _v0=v0*maxInputValue; + _localLuminanceFactor=1.0f; + _localLuminanceAddon=meanLuminance*v0; + _maxInputValue=maxInputValue; + } /** * update compression parameters while keeping v0 parameter value * @param meanLuminance the input frame mean luminance */ - inline void updateCompressionParameter(const float meanLuminance){_localLuminanceFactor=1; _localLuminanceAddon=meanLuminance*_v0;}; + inline void updateCompressionParameter(const float meanLuminance) + { + _localLuminanceFactor=1; + _localLuminanceAddon=meanLuminance*_v0; + } /** * @return the v0 compression parameter used to compute the local adaptation */ - float getV0CompressionParameter(){ return _v0/_maxInputValue;}; + float getV0CompressionParameter() { return _v0/_maxInputValue; } /** * @return the output result of the object */ - inline const std::valarray &getOutput() const {return _filterOutput;}; + inline const std::valarray &getOutput() const { return _filterOutput; } /** * @return number of rows of the filter */ - inline unsigned int getNBrows(){return _filterOutput.getNBrows();}; + inline unsigned int getNBrows() { return _filterOutput.getNBrows(); } /** * @return number of columns of the filter */ - inline unsigned int getNBcolumns(){return _filterOutput.getNBcolumns();}; + inline unsigned int getNBcolumns() { return _filterOutput.getNBcolumns(); } /** * @return number of pixels of the filter */ - inline unsigned int getNBpixels(){return _filterOutput.getNBpixels();}; + inline unsigned int getNBpixels() { return _filterOutput.getNBpixels(); } /** * force filter output to be normalized between 0 and maxValue * @param maxValue: the maximum output value that is required */ - inline void normalizeGrayOutput_0_maxOutputValue(const float maxValue){_filterOutput.normalizeGrayOutput_0_maxOutputValue(maxValue);}; + inline void normalizeGrayOutput_0_maxOutputValue(const float maxValue) { _filterOutput.normalizeGrayOutput_0_maxOutputValue(maxValue); } /** * force filter output to be normalized around 0 and rescaled with a sigmoide effect (extrem values saturation) * @param maxValue: the maximum output value that is required */ - inline void normalizeGrayOutputCentredSigmoide(){_filterOutput.normalizeGrayOutputCentredSigmoide();}; + inline void normalizeGrayOutputCentredSigmoide() { _filterOutput.normalizeGrayOutputCentredSigmoide(); } /** * force filter output to be normalized : data centering and std normalisation * @param maxValue: the maximum output value that is required */ - inline void centerReductImageLuminance(){_filterOutput.centerReductImageLuminance();}; + inline void centerReductImageLuminance() { _filterOutput.centerReductImageLuminance(); } /** * @return the maximum input buffer value */ - inline float getMaxInputValue(){return this->_maxInputValue;}; + inline float getMaxInputValue() { return _maxInputValue; } /** * @return the maximum input buffer value */ - inline void setMaxInputValue(const float newMaxInputValue){this->_maxInputValue=newMaxInputValue;}; + inline void setMaxInputValue(const float newMaxInputValue) { this->_maxInputValue=newMaxInputValue; } protected: @@ -577,7 +598,7 @@ namespace bioinspired float localLuminanceFactor, localLuminanceAddon, maxInputValue; public: Parallel_localAdaptation(const float *localLum, const float *inputImg, float *bufferToProcess, const float localLuminanceFact, const float localLuminanceAdd, const float maxInputVal) - :localLuminance(localLum), inputFrame(inputImg),outputFrame(bufferToProcess), localLuminanceFactor(localLuminanceFact), localLuminanceAddon(localLuminanceAdd), maxInputValue(maxInputVal) {}; + :localLuminance(localLum), inputFrame(inputImg),outputFrame(bufferToProcess), localLuminanceFactor(localLuminanceFact), localLuminanceAddon(localLuminanceAdd), maxInputValue(maxInputVal) {} virtual void operator()( const Range& r ) const { const float *localLuminancePTR=localLuminance+r.start; diff --git a/modules/bioinspired/src/imagelogpolprojection.hpp b/modules/bioinspired/src/imagelogpolprojection.hpp index 41ecd5eaf..e63990c83 100644 --- a/modules/bioinspired/src/imagelogpolprojection.hpp +++ b/modules/bioinspired/src/imagelogpolprojection.hpp @@ -158,38 +158,39 @@ public: /** * @return the numbers of rows (height) of the images OUTPUTS of the object */ - inline unsigned int getOutputNBrows(){return _outputNBrows;}; + inline unsigned int getOutputNBrows() { return _outputNBrows; } /** * @return the numbers of columns (width) of the images OUTPUTS of the object */ - inline unsigned int getOutputNBcolumns(){return _outputNBcolumns;}; + inline unsigned int getOutputNBcolumns() { return _outputNBcolumns; } /** * main funtion of the class: run projection function * @param size: one of the input frame initial dimensions to be processed * @return the output frame dimension */ - inline static unsigned int predictOutputSize(const unsigned int size, const double reductionFactor){return (unsigned int)((double)size/reductionFactor);}; + inline static unsigned int predictOutputSize(const unsigned int size, const double reductionFactor){return (unsigned int)((double)size/reductionFactor); } /** * @return the output of the filter which applies an irregular Low Pass spatial filter to the imag input (see function */ - inline const std::valarray &getIrregularLPfilteredInputFrame() const {return _irregularLPfilteredFrame;}; + inline const std::valarray &getIrregularLPfilteredInputFrame() const { return _irregularLPfilteredFrame; } /** * function which allows to retrieve the output frame which was updated after the "runProjection(...) function BasicRetinaFilter::runProgressiveFilter(...) * @return the projection result */ - inline const std::valarray &getSampledFrame() const {return _sampledFrame;}; + inline const std::valarray &getSampledFrame() const { return _sampledFrame; } /** * function which allows gives the tranformation table, its size is (getNBrows()*getNBcolumns()*2) * @return the transformation matrix [outputPixIndex_i, inputPixIndex_i, outputPixIndex_i+1, inputPixIndex_i+1....] */ - inline const std::valarray &getSamplingMap() const {return _transformTable;}; + inline const std::valarray &getSamplingMap() const { return _transformTable; } - inline double getOriginalRadiusLength(const double projectedRadiusLength){return _azero/(_alim-projectedRadiusLength*2.0/_minDimension);}; + inline double getOriginalRadiusLength(const double projectedRadiusLength) + { return _azero/(_alim-projectedRadiusLength*2.0/_minDimension); } // unsigned int getInputPixelIndex(const unsigned int ){ return _transformTable[index*2+1]}; diff --git a/modules/bioinspired/src/magnoretinafilter.hpp b/modules/bioinspired/src/magnoretinafilter.hpp index e06d14ddc..723537de8 100644 --- a/modules/bioinspired/src/magnoretinafilter.hpp +++ b/modules/bioinspired/src/magnoretinafilter.hpp @@ -151,27 +151,28 @@ namespace bioinspired /** * @return the Magnocellular ON channel filtering output */ - inline const std::valarray &getMagnoON() const {return _magnoXOutputON;}; + inline const std::valarray &getMagnoON() const { return _magnoXOutputON; } /** * @return the Magnocellular OFF channel filtering output */ - inline const std::valarray &getMagnoOFF() const {return _magnoXOutputOFF;}; + inline const std::valarray &getMagnoOFF() const { return _magnoXOutputOFF; } /** * @return the Magnocellular Y (sum of the ON and OFF magno channels) filtering output */ - inline const std::valarray &getMagnoYsaturated() const {return *_magnoYsaturated;}; + inline const std::valarray &getMagnoYsaturated() const { return *_magnoYsaturated; } /** * applies an image normalization which saturates the high output values by the use of an assymetric sigmoide */ - inline void normalizeGrayOutputNearZeroCentreredSigmoide(){_filterOutput.normalizeGrayOutputNearZeroCentreredSigmoide(&(*_magnoYOutput)[0], &(*_magnoYsaturated)[0]);}; + inline void normalizeGrayOutputNearZeroCentreredSigmoide() + { _filterOutput.normalizeGrayOutputNearZeroCentreredSigmoide(&(*_magnoYOutput)[0], &(*_magnoYsaturated)[0]); } /** * @return the horizontal cells' temporal constant */ - inline float getTemporalConstant(){return this->_filteringCoeficientsTable[2];}; + inline float getTemporalConstant() { return _filteringCoeficientsTable[2]; } private: diff --git a/modules/bioinspired/src/parvoretinafilter.hpp b/modules/bioinspired/src/parvoretinafilter.hpp index f5ffa1a06..0fc184792 100644 --- a/modules/bioinspired/src/parvoretinafilter.hpp +++ b/modules/bioinspired/src/parvoretinafilter.hpp @@ -150,7 +150,8 @@ public: * @param tau: time constant of the filter (unit is frame for video processing) * @param k: spatial constant of the filter (unit is pixels) */ - void setGanglionCellsLocalAdaptationLPfilterParameters(const float tau, const float k){BasicRetinaFilter::setLPfilterParameters(0, tau, k, 2);}; // change the parameters of the filter + void setGanglionCellsLocalAdaptationLPfilterParameters(const float tau, const float k) + { BasicRetinaFilter::setLPfilterParameters(0, tau, k, 2); } // change the parameters of the filter /** @@ -167,42 +168,42 @@ public: /** * @return the output of the photoreceptors filtering step (high cut frequency spatio-temporal low pass filter) */ - inline const std::valarray &getPhotoreceptorsLPfilteringOutput() const {return _photoreceptorsOutput;}; + inline const std::valarray &getPhotoreceptorsLPfilteringOutput() const { return _photoreceptorsOutput; } /** * @return the output of the photoreceptors filtering step (low cut frequency spatio-temporal low pass filter) */ - inline const std::valarray &getHorizontalCellsOutput() const { return _horizontalCellsOutput;}; + inline const std::valarray &getHorizontalCellsOutput() const { return _horizontalCellsOutput; } /** * @return the output Parvocellular ON channel of the retina model */ - inline const std::valarray &getParvoON() const {return _parvocellularOutputON;}; + inline const std::valarray &getParvoON() const { return _parvocellularOutputON; } /** * @return the output Parvocellular OFF channel of the retina model */ - inline const std::valarray &getParvoOFF() const {return _parvocellularOutputOFF;}; + inline const std::valarray &getParvoOFF() const { return _parvocellularOutputOFF; } /** * @return the output of the Bipolar cells of the ON channel of the retina model same as function getParvoON() but without luminance local adaptation */ - inline const std::valarray &getBipolarCellsON() const {return _bipolarCellsOutputON;}; + inline const std::valarray &getBipolarCellsON() const { return _bipolarCellsOutputON; } /** * @return the output of the Bipolar cells of the OFF channel of the retina model same as function getParvoON() but without luminance local adaptation */ - inline const std::valarray &getBipolarCellsOFF() const {return _bipolarCellsOutputOFF;}; + inline const std::valarray &getBipolarCellsOFF() const { return _bipolarCellsOutputOFF; } /** * @return the photoreceptors's temporal constant */ - inline float getPhotoreceptorsTemporalConstant(){return this->_filteringCoeficientsTable[2];}; + inline float getPhotoreceptorsTemporalConstant() { return _filteringCoeficientsTable[2]; } /** * @return the horizontal cells' temporal constant */ - inline float getHcellsTemporalConstant(){return this->_filteringCoeficientsTable[5];}; + inline float getHcellsTemporalConstant(){return _filteringCoeficientsTable[5]; } private: // template buffers diff --git a/modules/bioinspired/src/retina.cpp b/modules/bioinspired/src/retina.cpp index 303a7f32b..e43224028 100644 --- a/modules/bioinspired/src/retina.cpp +++ b/modules/bioinspired/src/retina.cpp @@ -101,14 +101,14 @@ public: virtual ~RetinaImpl(); /** - * retreive retina input buffer size - */ - Size getInputSize(); + * retreive retina input buffer size + */ + Size getInputSize(); /** - * retreive retina output buffer size - */ - Size getOutputSize(); + * retreive retina output buffer size + */ + Size getOutputSize(); /** * try to open an XML retina parameters file to adjust current retina instance setup @@ -127,7 +127,7 @@ public: * @param fs : the open Filestorage which contains retina parameters * @param applyDefaultSetupOnFailure : set to true if an error must be thrown on error */ - void setup(cv::FileStorage &fs, const bool applyDefaultSetupOnFailure=true); + void setup(cv::FileStorage &fs, const bool applyDefaultSetupOnFailure=true); /** * try to open an XML retina parameters file to adjust current retina instance setup @@ -248,17 +248,17 @@ public: */ void clearBuffers(); - /** - * Activate/desactivate the Magnocellular pathway processing (motion information extraction), by default, it is activated - * @param activate: true if Magnocellular output should be activated, false if not - */ - void activateMovingContoursProcessing(const bool activate); + /** + * Activate/desactivate the Magnocellular pathway processing (motion information extraction), by default, it is activated + * @param activate: true if Magnocellular output should be activated, false if not + */ + void activateMovingContoursProcessing(const bool activate); - /** - * Activate/desactivate the Parvocellular pathway processing (contours information extraction), by default, it is activated - * @param activate: true if Parvocellular (contours information extraction) output should be activated, false if not - */ - void activateContoursProcessing(const bool activate); + /** + * Activate/desactivate the Parvocellular pathway processing (contours information extraction), by default, it is activated + * @param activate: true if Parvocellular (contours information extraction) output should be activated, false if not + */ + void activateContoursProcessing(const bool activate); private: // Parameteres setup members @@ -399,7 +399,8 @@ void RetinaImpl::setup(cv::FileStorage &fs, const bool applyDefaultSetupOnFailur setupIPLMagnoChannel(_retinaParameters.IplMagno.normaliseOutput, _retinaParameters.IplMagno.parasolCells_beta, _retinaParameters.IplMagno.parasolCells_tau, _retinaParameters.IplMagno.parasolCells_k, _retinaParameters.IplMagno.amacrinCellsTemporalCutFrequency,_retinaParameters.IplMagno.V0CompressionParameter, _retinaParameters.IplMagno.localAdaptintegration_tau, _retinaParameters.IplMagno.localAdaptintegration_k); - }catch(Exception &e) + } + catch(Exception &e) { printf("RetinaImpl::setup: resetting retina with default parameters\n"); if (applyDefaultSetupOnFailure) @@ -657,7 +658,8 @@ void RetinaImpl::_convertValarrayBuffer2cvMat(const std::valarray &grayMa outMat.at(pixel)=(unsigned char)*(valarrayPTR++); } } - }else + } + else { const unsigned int nbPixels=nbColumns*nbRows; const unsigned int doubleNBpixels=nbColumns*nbRows*2; @@ -727,17 +729,17 @@ bool RetinaImpl::_convertCvMat2ValarrayBuffer(InputArray inputMat, std::valarray cv::Mat dst(inputMatToConvert.size(), dsttype, &outputValarrayMatrix[0]); inputMatToConvert.convertTo(dst, dsttype); } - else - CV_Error(Error::StsUnsupportedFormat, "input image must be single channel (gray levels), bgr format (color) or bgra (color with transparency which won't be considered"); + else + CV_Error(Error::StsUnsupportedFormat, "input image must be single channel (gray levels), bgr format (color) or bgra (color with transparency which won't be considered"); return imageNumberOfChannels>1; // return bool : false for gray level image processing, true for color mode } -void RetinaImpl::clearBuffers() {_retinaFilter->clearAllBuffers();} +void RetinaImpl::clearBuffers() { _retinaFilter->clearAllBuffers(); } -void RetinaImpl::activateMovingContoursProcessing(const bool activate){_retinaFilter->activateMovingContoursProcessing(activate);} +void RetinaImpl::activateMovingContoursProcessing(const bool activate) { _retinaFilter->activateMovingContoursProcessing(activate); } -void RetinaImpl::activateContoursProcessing(const bool activate){_retinaFilter->activateContoursProcessing(activate);} +void RetinaImpl::activateContoursProcessing(const bool activate) { _retinaFilter->activateContoursProcessing(activate); } }// end of namespace bioinspired }// end of namespace cv diff --git a/modules/bioinspired/src/retina_ocl.cpp b/modules/bioinspired/src/retina_ocl.cpp index 5d2b4bd15..51f43f38b 100644 --- a/modules/bioinspired/src/retina_ocl.cpp +++ b/modules/bioinspired/src/retina_ocl.cpp @@ -122,7 +122,7 @@ RetinaOCLImpl::RetinaOCLImpl(const cv::Size inputSz, const bool colorMode, int c { _retinaFilter = 0; _init(inputSz, colorMode, colorSamplingMethod, useRetinaLogSampling, reductionFactor, samplingStrenght); -}; +} RetinaOCLImpl::~RetinaOCLImpl() { diff --git a/modules/bioinspired/src/retina_ocl.hpp b/modules/bioinspired/src/retina_ocl.hpp index 90df0601c..11da48b93 100644 --- a/modules/bioinspired/src/retina_ocl.hpp +++ b/modules/bioinspired/src/retina_ocl.hpp @@ -70,16 +70,16 @@ public: inline void clearOutputBuffer() { _filterOutput = 0; - }; + } inline void clearSecondaryBuffer() { _localBuffer = 0; - }; + } inline void clearAllBuffers() { clearOutputBuffer(); clearSecondaryBuffer(); - }; + } void resize(const unsigned int NBrows, const unsigned int NBcolumns); const cv::ocl::oclMat &runFilter_LPfilter(const cv::ocl::oclMat &inputFrame, const unsigned int filterIndex = 0); void runFilter_LPfilter(const cv::ocl::oclMat &inputFrame, cv::ocl::oclMat &outputFrame, const unsigned int filterIndex = 0); @@ -95,69 +95,69 @@ public: _localLuminanceFactor = v0; _localLuminanceAddon = maxInputValue * (1.0f - v0); _maxInputValue = maxInputValue; - }; + } inline void setV0CompressionParameter(const float v0, const float meanLuminance) { this->setV0CompressionParameter(v0, _maxInputValue, meanLuminance); - }; + } inline void setV0CompressionParameter(const float v0) { _v0 = v0 * _maxInputValue; _localLuminanceFactor = v0; _localLuminanceAddon = _maxInputValue * (1.0f - v0); - }; + } inline void setV0CompressionParameterToneMapping(const float v0, const float maxInputValue, const float meanLuminance = 128.0f) { _v0 = v0 * maxInputValue; _localLuminanceFactor = 1.0f; _localLuminanceAddon = meanLuminance * _v0; _maxInputValue = maxInputValue; - }; + } inline void updateCompressionParameter(const float meanLuminance) { _localLuminanceFactor = 1; _localLuminanceAddon = meanLuminance * _v0; - }; + } inline float getV0CompressionParameter() { return _v0 / _maxInputValue; - }; + } inline const cv::ocl::oclMat &getOutput() const { return _filterOutput; - }; + } inline unsigned int getNBrows() { return _filterOutput.rows; - }; + } inline unsigned int getNBcolumns() { return _filterOutput.cols; - }; + } inline unsigned int getNBpixels() { return _filterOutput.size().area(); - }; + } inline void normalizeGrayOutput_0_maxOutputValue(const float maxValue) { ocl::normalizeGrayOutput_0_maxOutputValue(_filterOutput, maxValue); - }; + } inline void normalizeGrayOutputCentredSigmoide() { ocl::normalizeGrayOutputCentredSigmoide(0.0, 2.0, _filterOutput, _filterOutput); - }; + } inline void centerReductImageLuminance() { ocl::centerReductImageLuminance(_filterOutput); - }; + } inline float getMaxInputValue() { return this->_maxInputValue; - }; + } inline void setMaxInputValue(const float newMaxInputValue) { this->_maxInputValue = newMaxInputValue; - }; + } protected: @@ -209,23 +209,23 @@ public: inline const cv::ocl::oclMat &getMagnoON() const { return _magnoXOutputON; - }; + } inline const cv::ocl::oclMat &getMagnoOFF() const { return _magnoXOutputOFF; - }; + } inline const cv::ocl::oclMat &getMagnoYsaturated() const { return _magnoYsaturated; - }; + } inline void normalizeGrayOutputNearZeroCentreredSigmoide() { ocl::normalizeGrayOutputNearZeroCentreredSigmoide(_magnoYOutput, _magnoYsaturated); - }; + } inline float getTemporalConstant() { return this->_filteringCoeficientsTable[2]; - }; + } private: cv::ocl::oclMat _previousInput_ON; cv::ocl::oclMat _previousInput_OFF; @@ -254,48 +254,48 @@ public: inline void setGanglionCellsLocalAdaptationLPfilterParameters(const float tau, const float k) { BasicRetinaFilter::setLPfilterParameters(0, tau, k, 2); - }; + } const cv::ocl::oclMat &runFilter(const cv::ocl::oclMat &inputFrame, const bool useParvoOutput = true); inline const cv::ocl::oclMat &getPhotoreceptorsLPfilteringOutput() const { return _photoreceptorsOutput; - }; + } inline const cv::ocl::oclMat &getHorizontalCellsOutput() const { return _horizontalCellsOutput; - }; + } inline const cv::ocl::oclMat &getParvoON() const { return _parvocellularOutputON; - }; + } inline const cv::ocl::oclMat &getParvoOFF() const { return _parvocellularOutputOFF; - }; + } inline const cv::ocl::oclMat &getBipolarCellsON() const { return _bipolarCellsOutputON; - }; + } inline const cv::ocl::oclMat &getBipolarCellsOFF() const { return _bipolarCellsOutputOFF; - }; + } inline float getPhotoreceptorsTemporalConstant() { return this->_filteringCoeficientsTable[2]; - }; + } inline float getHcellsTemporalConstant() { return this->_filteringCoeficientsTable[5]; - }; + } private: cv::ocl::oclMat _photoreceptorsOutput; cv::ocl::oclMat _horizontalCellsOutput; @@ -319,7 +319,7 @@ public: inline void runColorMultiplexing(const cv::ocl::oclMat &inputRGBFrame) { runColorMultiplexing(inputRGBFrame, _multiplexedFrame); - }; + } void runColorMultiplexing(const cv::ocl::oclMat &demultiplexedInputFrame, cv::ocl::oclMat &multiplexedFrame); void runColorDemultiplexing(const cv::ocl::oclMat &multiplexedColorFrame, const bool adaptiveFiltering = false, const float maxInputValue = 255.0); @@ -327,39 +327,39 @@ public: { _saturateColors = saturateColors; _colorSaturationValue = colorSaturationValue; - }; + } void setChrominanceLPfilterParameters(const float beta, const float tau, const float k) { setLPfilterParameters(beta, tau, k); - }; + } bool applyKrauskopfLMS2Acr1cr2Transform(cv::ocl::oclMat &result); bool applyLMS2LabTransform(cv::ocl::oclMat &result); inline const cv::ocl::oclMat &getMultiplexedFrame() const { return _multiplexedFrame; - }; + } inline const cv::ocl::oclMat &getDemultiplexedColorFrame() const { return _demultiplexedColorFrame; - }; + } inline const cv::ocl::oclMat &getLuminance() const { return _luminance; - }; + } inline const cv::ocl::oclMat &getChrominance() const { return _chrominance; - }; + } void clipRGBOutput_0_maxInputValue(cv::ocl::oclMat &inputOutputBuffer, const float maxOutputValue = 255.0); void normalizeRGBOutput_0_maxOutputValue(const float maxOutputValue = 255.0); inline void setDemultiplexedColorFrame(const cv::ocl::oclMat &demultiplexedImage) { _demultiplexedColorFrame = demultiplexedImage; - }; + } protected: inline unsigned int bayerSampleOffset(unsigned int index) { @@ -410,13 +410,13 @@ public: { _photoreceptorsPrefilter.setV0CompressionParameter(1 - V0CompressionParameter); _setInitPeriodCount(); - }; + } inline void setParvoGanglionCellsLocalAdaptationSensitivity(const float V0CompressionParameter) { _ParvoRetinaFilter.setV0CompressionParameter(V0CompressionParameter); _setInitPeriodCount(); - }; + } inline void setGanglionCellsLocalAdaptationLPfilterParameters(const float spatialResponse, const float temporalResponse) { @@ -428,137 +428,137 @@ public: { _MagnoRetinaFilter.setV0CompressionParameter(V0CompressionParameter); _setInitPeriodCount(); - }; + } void setOPLandParvoParameters(const float beta1, const float tau1, const float k1, const float beta2, const float tau2, const float k2, const float V0CompressionParameter) { _ParvoRetinaFilter.setOPLandParvoFiltersParameters(beta1, tau1, k1, beta2, tau2, k2); _ParvoRetinaFilter.setV0CompressionParameter(V0CompressionParameter); _setInitPeriodCount(); - }; + } void setMagnoCoefficientsTable(const float parasolCells_beta, const float parasolCells_tau, const float parasolCells_k, const float amacrinCellsTemporalCutFrequency, const float V0CompressionParameter, const float localAdaptintegration_tau, const float localAdaptintegration_k) { _MagnoRetinaFilter.setCoefficientsTable(parasolCells_beta, parasolCells_tau, parasolCells_k, amacrinCellsTemporalCutFrequency, localAdaptintegration_tau, localAdaptintegration_k); _MagnoRetinaFilter.setV0CompressionParameter(V0CompressionParameter); _setInitPeriodCount(); - }; + } inline void activateNormalizeParvoOutput_0_maxOutputValue(const bool normalizeParvoOutput_0_maxOutputValue) { _normalizeParvoOutput_0_maxOutputValue = normalizeParvoOutput_0_maxOutputValue; - }; + } inline void activateNormalizeMagnoOutput_0_maxOutputValue(const bool normalizeMagnoOutput_0_maxOutputValue) { _normalizeMagnoOutput_0_maxOutputValue = normalizeMagnoOutput_0_maxOutputValue; - }; + } inline void setMaxOutputValue(const float maxOutputValue) { _maxOutputValue = maxOutputValue; - }; + } void setColorMode(const bool desiredColorMode) { _useColorMode = desiredColorMode; - }; + } inline void setColorSaturation(const bool saturateColors = true, const float colorSaturationValue = 4.0) { _colorEngine.setColorSaturation(saturateColors, colorSaturationValue); - }; + } inline const cv::ocl::oclMat &getLocalAdaptation() const { return _photoreceptorsPrefilter.getOutput(); - }; + } inline const cv::ocl::oclMat &getPhotoreceptors() const { return _ParvoRetinaFilter.getPhotoreceptorsLPfilteringOutput(); - }; + } inline const cv::ocl::oclMat &getHorizontalCells() const { return _ParvoRetinaFilter.getHorizontalCellsOutput(); - }; + } inline bool areContoursProcessed() { return _useParvoOutput; - }; + } bool getParvoFoveaResponse(cv::ocl::oclMat &parvoFovealResponse); inline void activateContoursProcessing(const bool useParvoOutput) { _useParvoOutput = useParvoOutput; - }; + } const cv::ocl::oclMat &getContours(); inline const cv::ocl::oclMat &getContoursON() const { return _ParvoRetinaFilter.getParvoON(); - }; + } inline const cv::ocl::oclMat &getContoursOFF() const { return _ParvoRetinaFilter.getParvoOFF(); - }; + } inline bool areMovingContoursProcessed() { return _useMagnoOutput; - }; + } inline void activateMovingContoursProcessing(const bool useMagnoOutput) { _useMagnoOutput = useMagnoOutput; - }; + } inline const cv::ocl::oclMat &getMovingContours() const { return _MagnoRetinaFilter.getOutput(); - }; + } inline const cv::ocl::oclMat &getMovingContoursSaturated() const { return _MagnoRetinaFilter.getMagnoYsaturated(); - }; + } inline const cv::ocl::oclMat &getMovingContoursON() const { return _MagnoRetinaFilter.getMagnoON(); - }; + } inline const cv::ocl::oclMat &getMovingContoursOFF() const { return _MagnoRetinaFilter.getMagnoOFF(); - }; + } inline const cv::ocl::oclMat &getRetinaParvoMagnoMappedOutput() const { return _retinaParvoMagnoMappedFrame; - }; + } inline const cv::ocl::oclMat &getParvoContoursChannel() const { return _colorEngine.getLuminance(); - }; + } inline const cv::ocl::oclMat &getParvoChrominance() const { return _colorEngine.getChrominance(); - }; + } inline const cv::ocl::oclMat &getColorOutput() const { return _colorEngine.getDemultiplexedColorFrame(); - }; + } inline bool isColorMode() { return _useColorMode; - }; + } bool getColorMode() { return _useColorMode; - }; + } inline bool isInitTransitionDone() { @@ -567,41 +567,41 @@ public: return false; } return true; - }; + } inline float getRetinaSamplingBackProjection(const float projectedRadiusLength) { return projectedRadiusLength; - }; + } inline unsigned int getInputNBrows() { return _photoreceptorsPrefilter.getNBrows(); - }; + } inline unsigned int getInputNBcolumns() { return _photoreceptorsPrefilter.getNBcolumns(); - }; + } inline unsigned int getInputNBpixels() { return _photoreceptorsPrefilter.getNBpixels(); - }; + } inline unsigned int getOutputNBrows() { return _photoreceptorsPrefilter.getNBrows(); - }; + } inline unsigned int getOutputNBcolumns() { return _photoreceptorsPrefilter.getNBcolumns(); - }; + } inline unsigned int getOutputNBpixels() { return _photoreceptorsPrefilter.getNBpixels(); - }; + } private: bool _useParvoOutput; bool _useMagnoOutput; diff --git a/modules/bioinspired/src/retinacolor.hpp b/modules/bioinspired/src/retinacolor.hpp index 3fb6be8f9..ff7990638 100644 --- a/modules/bioinspired/src/retinacolor.hpp +++ b/modules/bioinspired/src/retinacolor.hpp @@ -125,7 +125,7 @@ namespace bioinspired * @param inputRGBFrame: the input RGB frame to be processed * @return, nothing but the multiplexed frame is available by the use of the getMultiplexedFrame() function */ - inline void runColorMultiplexing(const std::valarray &inputRGBFrame){runColorMultiplexing(inputRGBFrame, *_multiplexedFrame);}; + inline void runColorMultiplexing(const std::valarray &inputRGBFrame) { runColorMultiplexing(inputRGBFrame, *_multiplexedFrame); } /** * color multiplexing function: a demultipleed RGB frame of size M*N*3 is transformed into a multiplexed M*N*1 pixels frame where each pixel is either Red, or Green or Blue if using RGB images @@ -149,7 +149,7 @@ namespace bioinspired * @param saturateColors: boolean that activates color saturation (if true) or desactivate (if false) * @param colorSaturationValue: the saturation factor * */ - void setColorSaturation(const bool saturateColors=true, const float colorSaturationValue=4.0){_saturateColors=saturateColors; _colorSaturationValue=colorSaturationValue;}; + void setColorSaturation(const bool saturateColors=true, const float colorSaturationValue=4.0) { _saturateColors=saturateColors; _colorSaturationValue=colorSaturationValue; } /** * set parameters of the low pass spatio-temporal filter used to retreive the low chrominance @@ -157,7 +157,7 @@ namespace bioinspired * @param tau: time constant of the filter (unit is frame for video processing), typically 0 when considering static processing, 1 or more if a temporal smoothing effect is required * @param k: spatial constant of the filter (unit is pixels), typical value is 2.5 */ - void setChrominanceLPfilterParameters(const float beta, const float tau, const float k){setLPfilterParameters(beta, tau, k);}; + void setChrominanceLPfilterParameters(const float beta, const float tau, const float k) { setLPfilterParameters(beta, tau, k); } /** * apply to the retina color output the Krauskopf transformation which leads to an opponent color system: output colorspace if Acr1cr2 if input of the retina was LMS color space @@ -176,22 +176,22 @@ namespace bioinspired /** * @return the multiplexed frame result (use this after function runColorMultiplexing) */ - inline const std::valarray &getMultiplexedFrame() const {return *_multiplexedFrame;}; + inline const std::valarray &getMultiplexedFrame() const { return *_multiplexedFrame; } /** * @return the demultiplexed frame result (use this after function runColorDemultiplexing) */ - inline const std::valarray &getDemultiplexedColorFrame() const {return _demultiplexedColorFrame;}; + inline const std::valarray &getDemultiplexedColorFrame() const { return _demultiplexedColorFrame; } /** * @return the luminance of the processed frame (use this after function runColorDemultiplexing) */ - inline const std::valarray &getLuminance() const {return *_luminance;}; + inline const std::valarray &getLuminance() const { return *_luminance; } /** * @return the chrominance of the processed frame (use this after function runColorDemultiplexing) */ - inline const std::valarray &getChrominance() const {return _chrominance;}; + inline const std::valarray &getChrominance() const { return _chrominance; } /** * standard 0 to 255 image clipping function appled to RGB images (of size M*N*3 pixels) @@ -209,13 +209,13 @@ namespace bioinspired /** * return the color sampling map: a Nrows*Mcolumns image in which each pixel value is the ofsset adress which gives the adress of the sampled pixel on an Nrows*Mcolumns*3 color image ordered by layers: layer1, layer2, layer3 */ - inline const std::valarray &getSamplingMap() const {return _colorSampling;}; + inline const std::valarray &getSamplingMap() const { return _colorSampling; } /** * function used (to bypass processing) to manually set the color output * @param demultiplexedImage: the color image (luminance+chrominance) which has to be written in the object buffer */ - inline void setDemultiplexedColorFrame(const std::valarray &demultiplexedImage){_demultiplexedColorFrame=demultiplexedImage;}; + inline void setDemultiplexedColorFrame(const std::valarray &demultiplexedImage) { _demultiplexedColorFrame=demultiplexedImage; } protected: @@ -287,9 +287,10 @@ namespace bioinspired unsigned int nbColumns; public: Parallel_adaptiveHorizontalCausalFilter_addInput(const float *inputImg, float *bufferToProcess, const float *imageGrad, const unsigned int nbCols) - :outputFrame(bufferToProcess), inputFrame(inputImg), imageGradient(imageGrad), nbColumns(nbCols) {}; + :outputFrame(bufferToProcess), inputFrame(inputImg), imageGradient(imageGrad), nbColumns(nbCols) { } - virtual void operator()( const Range& r ) const { + virtual void operator()( const Range& r ) const + { register float* outputPTR=outputFrame+r.start*nbColumns; register const float* inputPTR=inputFrame+r.start*nbColumns; register const float *imageGradientPTR= imageGradient+r.start*nbColumns; @@ -314,7 +315,7 @@ namespace bioinspired float filterParam_gain; public: Parallel_adaptiveVerticalAnticausalFilter_multGain(float *bufferToProcess, const float *imageGrad, const unsigned int nbRws, const unsigned int nbCols, const float gain) - :outputFrame(bufferToProcess), imageGradient(imageGrad), nbRows(nbRws), nbColumns(nbCols), filterParam_gain(gain){} + :outputFrame(bufferToProcess), imageGradient(imageGrad), nbRows(nbRws), nbColumns(nbCols), filterParam_gain(gain) { } virtual void operator()( const Range& r ) const { float* offset=outputFrame+nbColumns*nbRows-nbColumns; @@ -343,7 +344,7 @@ namespace bioinspired unsigned int nbColumns, doubleNbColumns, nbRows, nbPixels; public: Parallel_computeGradient(const unsigned int nbCols, const unsigned int nbRws, const float *lum, float *imageGrad) - :imageGradient(imageGrad), luminance(lum), nbColumns(nbCols), doubleNbColumns(2*nbCols), nbRows(nbRws), nbPixels(nbRws*nbCols){}; + :imageGradient(imageGrad), luminance(lum), nbColumns(nbCols), doubleNbColumns(2*nbCols), nbRows(nbRws), nbPixels(nbRws*nbCols) { } virtual void operator()( const Range& r ) const { for (int idLine=r.start;idLine!=r.end;++idLine) diff --git a/modules/bioinspired/src/retinafasttonemapping.cpp b/modules/bioinspired/src/retinafasttonemapping.cpp index 2713d7449..776e68c90 100644 --- a/modules/bioinspired/src/retinafasttonemapping.cpp +++ b/modules/bioinspired/src/retinafasttonemapping.cpp @@ -124,7 +124,7 @@ public: /** * basic destructor */ - virtual ~RetinaFastToneMappingImpl(){}; + virtual ~RetinaFastToneMappingImpl() { } /** * method that applies a luminance correction (initially High Dynamic Range (HDR) tone mapping) using only the 2 local adaptation stages of the retina parvocellular channel : photoreceptors level and ganlion cells level. Spatio temporal filtering is applied but limited to temporal smoothing and eventually high frequencies attenuation. This is a lighter method than the one available using the regular retina::run method. It is then faster but it does not include complete temporal filtering nor retina spectral whitening. Then, it can have a more limited effect on images with a very high dynamic range. This is an adptation of the original still image HDR tone mapping algorithm of David Alleyson, Sabine Susstruck and Laurence Meylan's work, please cite: @@ -142,7 +142,8 @@ public: { _runRGBToneMapping(_inputBuffer, _imageOutput, true); _convertValarrayBuffer2cvMat(_imageOutput, _multiuseFilter->getNBrows(), _multiuseFilter->getNBcolumns(), true, outputToneMappedImage); - }else + } + else { _runGrayToneMapping(_inputBuffer, _imageOutput); _convertValarrayBuffer2cvMat(_imageOutput, _multiuseFilter->getNBrows(), _multiuseFilter->getNBcolumns(), false, outputToneMappedImage); @@ -193,7 +194,8 @@ void _convertValarrayBuffer2cvMat(const std::valarray &grayMatrixToConver outMat.at(pixel)=(unsigned char)*(valarrayPTR++); } } - }else + } + else { const unsigned int nbPixels=nbColumns*nbRows; const unsigned int doubleNBpixels=nbColumns*nbRows*2; @@ -263,47 +265,47 @@ bool _convertCvMat2ValarrayBuffer(InputArray inputMat, std::valarray &out cv::Mat dst(inputMatToConvert.size(), dsttype, &outputValarrayMatrix[0]); inputMatToConvert.convertTo(dst, dsttype); } - else - CV_Error(Error::StsUnsupportedFormat, "input image must be single channel (gray levels), bgr format (color) or bgra (color with transparency which won't be considered"); + else + CV_Error(Error::StsUnsupportedFormat, "input image must be single channel (gray levels), bgr format (color) or bgra (color with transparency which won't be considered"); return imageNumberOfChannels>1; // return bool : false for gray level image processing, true for color mode } - // run the initilized retina filter in order to perform gray image tone mapping, after this call all retina outputs are updated - void _runGrayToneMapping(const std::valarray &grayImageInput, std::valarray &grayImageOutput) - { - // apply tone mapping on the multiplexed image - // -> photoreceptors local adaptation (large area adaptation) - _multiuseFilter->runFilter_LPfilter(grayImageInput, grayImageOutput, 0); // compute low pass filtering modeling the horizontal cells filtering to acess local luminance - _multiuseFilter->setV0CompressionParameterToneMapping(1.f, grayImageOutput.max(), _meanLuminanceModulatorK*grayImageOutput.sum()/(float)_multiuseFilter->getNBpixels()); - _multiuseFilter->runFilter_LocalAdapdation(grayImageInput, grayImageOutput, _temp2); // adapt contrast to local luminance +// run the initilized retina filter in order to perform gray image tone mapping, after this call all retina outputs are updated +void _runGrayToneMapping(const std::valarray &grayImageInput, std::valarray &grayImageOutput) +{ + // apply tone mapping on the multiplexed image + // -> photoreceptors local adaptation (large area adaptation) + _multiuseFilter->runFilter_LPfilter(grayImageInput, grayImageOutput, 0); // compute low pass filtering modeling the horizontal cells filtering to acess local luminance + _multiuseFilter->setV0CompressionParameterToneMapping(1.f, grayImageOutput.max(), _meanLuminanceModulatorK*grayImageOutput.sum()/(float)_multiuseFilter->getNBpixels()); + _multiuseFilter->runFilter_LocalAdapdation(grayImageInput, grayImageOutput, _temp2); // adapt contrast to local luminance - // -> ganglion cells local adaptation (short area adaptation) - _multiuseFilter->runFilter_LPfilter(_temp2, grayImageOutput, 1); // compute low pass filtering (high cut frequency (remove spatio-temporal noise) - _multiuseFilter->setV0CompressionParameterToneMapping(1.f, _temp2.max(), _meanLuminanceModulatorK*grayImageOutput.sum()/(float)_multiuseFilter->getNBpixels()); - _multiuseFilter->runFilter_LocalAdapdation(_temp2, grayImageOutput, grayImageOutput); // adapt contrast to local luminance + // -> ganglion cells local adaptation (short area adaptation) + _multiuseFilter->runFilter_LPfilter(_temp2, grayImageOutput, 1); // compute low pass filtering (high cut frequency (remove spatio-temporal noise) + _multiuseFilter->setV0CompressionParameterToneMapping(1.f, _temp2.max(), _meanLuminanceModulatorK*grayImageOutput.sum()/(float)_multiuseFilter->getNBpixels()); + _multiuseFilter->runFilter_LocalAdapdation(_temp2, grayImageOutput, grayImageOutput); // adapt contrast to local luminance - } +} - // run the initilized retina filter in order to perform color tone mapping, after this call all retina outputs are updated - void _runRGBToneMapping(const std::valarray &RGBimageInput, std::valarray &RGBimageOutput, const bool useAdaptiveFiltering) - { - // multiplex the image with the color sampling method specified in the constructor - _colorEngine->runColorMultiplexing(RGBimageInput); +// run the initilized retina filter in order to perform color tone mapping, after this call all retina outputs are updated +void _runRGBToneMapping(const std::valarray &RGBimageInput, std::valarray &RGBimageOutput, const bool useAdaptiveFiltering) +{ + // multiplex the image with the color sampling method specified in the constructor + _colorEngine->runColorMultiplexing(RGBimageInput); - // apply tone mapping on the multiplexed image - _runGrayToneMapping(_colorEngine->getMultiplexedFrame(), RGBimageOutput); + // apply tone mapping on the multiplexed image + _runGrayToneMapping(_colorEngine->getMultiplexedFrame(), RGBimageOutput); - // demultiplex tone maped image - _colorEngine->runColorDemultiplexing(RGBimageOutput, useAdaptiveFiltering, _multiuseFilter->getMaxInputValue());//_ColorEngine->getMultiplexedFrame());//_ParvoRetinaFilter->getPhotoreceptorsLPfilteringOutput()); + // demultiplex tone maped image + _colorEngine->runColorDemultiplexing(RGBimageOutput, useAdaptiveFiltering, _multiuseFilter->getMaxInputValue());//_ColorEngine->getMultiplexedFrame());//_ParvoRetinaFilter->getPhotoreceptorsLPfilteringOutput()); - // rescaling result between 0 and 255 - _colorEngine->normalizeRGBOutput_0_maxOutputValue(255.0); + // rescaling result between 0 and 255 + _colorEngine->normalizeRGBOutput_0_maxOutputValue(255.0); - // return the result - RGBimageOutput=_colorEngine->getDemultiplexedColorFrame(); - } + // return the result + RGBimageOutput=_colorEngine->getDemultiplexedColorFrame(); +} }; diff --git a/modules/bioinspired/src/retinafilter.hpp b/modules/bioinspired/src/retinafilter.hpp index 3e204885f..5b254c8ac 100644 --- a/modules/bioinspired/src/retinafilter.hpp +++ b/modules/bioinspired/src/retinafilter.hpp @@ -222,26 +222,26 @@ public: * setup the local luminance adaptation capability * @param V0CompressionParameter: the compression strengh of the photoreceptors local adaptation output, set a value between 160 and 250 for best results, a high value increases more the low value sensitivity... and the output saturates faster, recommended value: 160 */ - inline void setPhotoreceptorsLocalAdaptationSensitivity(const float V0CompressionParameter){_photoreceptorsPrefilter.setV0CompressionParameter(1-V0CompressionParameter);_setInitPeriodCount();}; + inline void setPhotoreceptorsLocalAdaptationSensitivity(const float V0CompressionParameter) { _photoreceptorsPrefilter.setV0CompressionParameter(1-V0CompressionParameter);_setInitPeriodCount(); } /** * setup the local luminance adaptation capability * @param V0CompressionParameter: the compression strengh of the parvocellular pathway (details) local adaptation output, set a value between 160 and 250 for best results, a high value increases more the low value sensitivity... and the output saturates faster, recommended value: 160 */ - inline void setParvoGanglionCellsLocalAdaptationSensitivity(const float V0CompressionParameter){_ParvoRetinaFilter.setV0CompressionParameter(V0CompressionParameter);_setInitPeriodCount();}; + inline void setParvoGanglionCellsLocalAdaptationSensitivity(const float V0CompressionParameter) { _ParvoRetinaFilter.setV0CompressionParameter(V0CompressionParameter);_setInitPeriodCount(); } /** * setup the local luminance adaptation area of integration * @param spatialResponse: the spatial constant of the low pass filter applied on the bipolar cells output in order to compute local contrast mean values * @param temporalResponse: the spatial constant of the low pass filter applied on the bipolar cells output in order to compute local contrast mean values (generally set to zero: immediate response) */ - inline void setGanglionCellsLocalAdaptationLPfilterParameters(const float spatialResponse, const float temporalResponse){_ParvoRetinaFilter.setGanglionCellsLocalAdaptationLPfilterParameters(temporalResponse, spatialResponse);_setInitPeriodCount();}; + inline void setGanglionCellsLocalAdaptationLPfilterParameters(const float spatialResponse, const float temporalResponse) { _ParvoRetinaFilter.setGanglionCellsLocalAdaptationLPfilterParameters(temporalResponse, spatialResponse);_setInitPeriodCount(); } /** * setup the local luminance adaptation capability * @param V0CompressionParameter: the compression strengh of the magnocellular pathway (motion) local adaptation output, set a value between 160 and 250 for best results, a high value increases more the low value sensitivity... and the output saturates faster, recommended value: 160 */ - inline void setMagnoGanglionCellsLocalAdaptationSensitivity(const float V0CompressionParameter){_MagnoRetinaFilter.setV0CompressionParameter(V0CompressionParameter);_setInitPeriodCount();}; + inline void setMagnoGanglionCellsLocalAdaptationSensitivity(const float V0CompressionParameter) { _MagnoRetinaFilter.setV0CompressionParameter(V0CompressionParameter);_setInitPeriodCount(); } /** * setup the OPL and IPL parvo channels @@ -253,7 +253,7 @@ public: * @param k2: the spatial constant of the first order low pass filter of the horizontal cells, use it to cut low spatial frequencies (local luminance), unit is pixels, typical value is 5 pixel, this value is also used for local contrast computing when computing the local contrast adaptation at the ganglion cells level (Inner Plexiform Layer parvocellular channel model) * @param V0CompressionParameter: the compression strengh of the ganglion cells local adaptation output, set a value between 160 and 250 for best results, a high value increases more the low value sensitivity... and the output saturates faster, recommended value: 230 */ - void setOPLandParvoParameters(const float beta1, const float tau1, const float k1, const float beta2, const float tau2, const float k2, const float V0CompressionParameter){_ParvoRetinaFilter.setOPLandParvoFiltersParameters(beta1, tau1, k1, beta2, tau2, k2);_ParvoRetinaFilter.setV0CompressionParameter(V0CompressionParameter);_setInitPeriodCount();}; + void setOPLandParvoParameters(const float beta1, const float tau1, const float k1, const float beta2, const float tau2, const float k2, const float V0CompressionParameter) { _ParvoRetinaFilter.setOPLandParvoFiltersParameters(beta1, tau1, k1, beta2, tau2, k2);_ParvoRetinaFilter.setV0CompressionParameter(V0CompressionParameter);_setInitPeriodCount(); } /** * set parameters values for the Inner Plexiform Layer (IPL) magnocellular channel @@ -265,31 +265,31 @@ public: * @param localAdaptintegration_tau: specifies the temporal constant of the low pas filter involved in the computation of the local "motion mean" for the local adaptation computation * @param localAdaptintegration_k: specifies the spatial constant of the low pas filter involved in the computation of the local "motion mean" for the local adaptation computation */ - void setMagnoCoefficientsTable(const float parasolCells_beta, const float parasolCells_tau, const float parasolCells_k, const float amacrinCellsTemporalCutFrequency, const float V0CompressionParameter, const float localAdaptintegration_tau, const float localAdaptintegration_k){_MagnoRetinaFilter.setCoefficientsTable(parasolCells_beta, parasolCells_tau, parasolCells_k, amacrinCellsTemporalCutFrequency, localAdaptintegration_tau, localAdaptintegration_k);_MagnoRetinaFilter.setV0CompressionParameter(V0CompressionParameter);_setInitPeriodCount();}; + void setMagnoCoefficientsTable(const float parasolCells_beta, const float parasolCells_tau, const float parasolCells_k, const float amacrinCellsTemporalCutFrequency, const float V0CompressionParameter, const float localAdaptintegration_tau, const float localAdaptintegration_k) { _MagnoRetinaFilter.setCoefficientsTable(parasolCells_beta, parasolCells_tau, parasolCells_k, amacrinCellsTemporalCutFrequency, localAdaptintegration_tau, localAdaptintegration_k);_MagnoRetinaFilter.setV0CompressionParameter(V0CompressionParameter);_setInitPeriodCount(); } /** * set if the parvo output should be or not normalized between 0 and 255 (for display purpose generally) * @param normalizeParvoOutput_0_maxOutputValue: true if normalization should be done */ - inline void activateNormalizeParvoOutput_0_maxOutputValue(const bool normalizeParvoOutput_0_maxOutputValue){_normalizeParvoOutput_0_maxOutputValue=normalizeParvoOutput_0_maxOutputValue;}; + inline void activateNormalizeParvoOutput_0_maxOutputValue(const bool normalizeParvoOutput_0_maxOutputValue) { _normalizeParvoOutput_0_maxOutputValue=normalizeParvoOutput_0_maxOutputValue; } /** * set if the magno output should be or not normalized between 0 and 255 (for display purpose generally), take care, if nothing is moving, then, the noise will be enanced !!! * @param normalizeMagnoOutput_0_maxOutputValue: true if normalization should be done */ - inline void activateNormalizeMagnoOutput_0_maxOutputValue(const bool normalizeMagnoOutput_0_maxOutputValue){_normalizeMagnoOutput_0_maxOutputValue=normalizeMagnoOutput_0_maxOutputValue;}; + inline void activateNormalizeMagnoOutput_0_maxOutputValue(const bool normalizeMagnoOutput_0_maxOutputValue) { _normalizeMagnoOutput_0_maxOutputValue=normalizeMagnoOutput_0_maxOutputValue; } /** * setup the maximum amplitude value of the normalized outputs (generally 255 for 8bit per channel pictures) * @param maxOutputValue: maximum amplitude value of the normalized outputs (generally 255 for 8bit per channel pictures) */ - inline void setMaxOutputValue(const float maxOutputValue){_maxOutputValue=maxOutputValue;}; + inline void setMaxOutputValue(const float maxOutputValue) { _maxOutputValue=maxOutputValue; } /** * sets the color mode of the frame grabber * @param desiredColorMode: true if the user needs color information, false for graylevels */ - void setColorMode(const bool desiredColorMode){_useColorMode=desiredColorMode;}; + void setColorMode(const bool desiredColorMode) { _useColorMode=desiredColorMode; } /** * activate color saturation as the final step of the color demultiplexing process @@ -297,7 +297,7 @@ public: * @param saturateColors: boolean that activates color saturation (if true) or desactivate (if false) * @param colorSaturationValue: the saturation factor * */ - inline void setColorSaturation(const bool saturateColors=true, const float colorSaturationValue=4.0){_colorEngine.setColorSaturation(saturateColors, colorSaturationValue);}; + inline void setColorSaturation(const bool saturateColors=true, const float colorSaturationValue=4.0) { _colorEngine.setColorSaturation(saturateColors, colorSaturationValue); } ///////////////////////////////////////////////////////////////// // function that retrieve the main retina outputs, one by one, or all in a structure @@ -314,23 +314,23 @@ public: /** * @return photoreceptors output, locally adapted luminance only, no high frequency spatio-temporal noise reduction at the next retina processing stages, use getPhotoreceptors method to get complete photoreceptors output */ - inline const std::valarray &getLocalAdaptation() const {return _photoreceptorsPrefilter.getOutput();}; + inline const std::valarray &getLocalAdaptation() const {return _photoreceptorsPrefilter.getOutput(); } /** * @return photoreceptors output: locally adapted luminance and high frequency spatio-temporal noise reduction, high luminance is a little saturated at this stage, but this is corrected naturally at the next retina processing stages */ - inline const std::valarray &getPhotoreceptors() const {return _ParvoRetinaFilter.getPhotoreceptorsLPfilteringOutput();}; + inline const std::valarray &getPhotoreceptors() const {return _ParvoRetinaFilter.getPhotoreceptorsLPfilteringOutput(); } /** * @return the local luminance of the processed frame (it is the horizontal cells output) */ - inline const std::valarray &getHorizontalCells() const {return _ParvoRetinaFilter.getHorizontalCellsOutput();}; + inline const std::valarray &getHorizontalCells() const {return _ParvoRetinaFilter.getHorizontalCellsOutput(); } ///////// CONTOURS part, PARVOCELLULAR RETINA PATHWAY /** * @return true if Parvocellular output is activated, false if not */ - inline bool areContoursProcessed(){return _useParvoOutput;}; + inline bool areContoursProcessed() { return _useParvoOutput; } /** * method to retrieve the foveal parvocellular pathway response (no details energy in parafovea) @@ -342,7 +342,7 @@ public: /** * @param useParvoOutput: true if Parvocellular output should be activated, false if not */ - inline void activateContoursProcessing(const bool useParvoOutput){_useParvoOutput=useParvoOutput;}; + inline void activateContoursProcessing(const bool useParvoOutput) { _useParvoOutput=useParvoOutput; } /** * @return the parvocellular contours information (details), should be used at the fovea level @@ -352,18 +352,18 @@ public: /** * @return the parvocellular contours ON information (details), should be used at the fovea level */ - inline const std::valarray &getContoursON() const {return _ParvoRetinaFilter.getParvoON();};// Parvocellular ON output + inline const std::valarray &getContoursON() const {return _ParvoRetinaFilter.getParvoON(); } // Parvocellular ON output /** * @return the parvocellular contours OFF information (details), should be used at the fovea level */ - inline const std::valarray &getContoursOFF() const {return _ParvoRetinaFilter.getParvoOFF();};// Parvocellular OFF output + inline const std::valarray &getContoursOFF() const {return _ParvoRetinaFilter.getParvoOFF(); } // Parvocellular OFF output ///////// MOVING CONTOURS part, MAGNOCELLULAR RETINA PATHWAY /** * @return true if Magnocellular output is activated, false if not */ - inline bool areMovingContoursProcessed(){return _useMagnoOutput;}; + inline bool areMovingContoursProcessed() { return _useMagnoOutput; } /** * method to retrieve the parafoveal magnocellular pathway response (no motion energy in fovea) @@ -375,87 +375,87 @@ public: /** * @param useMagnoOutput: true if Magnoocellular output should be activated, false if not */ - inline void activateMovingContoursProcessing(const bool useMagnoOutput){_useMagnoOutput=useMagnoOutput;}; + inline void activateMovingContoursProcessing(const bool useMagnoOutput) { _useMagnoOutput=useMagnoOutput; } /** * @return the magnocellular moving contours information (motion), should be used at the parafovea level without post-processing */ - inline const std::valarray &getMovingContours() const {return _MagnoRetinaFilter.getOutput();};// Magnocellular output + inline const std::valarray &getMovingContours() const {return _MagnoRetinaFilter.getOutput(); } // Magnocellular output /** * @return the magnocellular moving contours information (motion), should be used at the parafovea level with assymetric sigmoide post-processing which saturates motion information */ - inline const std::valarray &getMovingContoursSaturated() const {return _MagnoRetinaFilter.getMagnoYsaturated();};// Saturated Magnocellular output + inline const std::valarray &getMovingContoursSaturated() const {return _MagnoRetinaFilter.getMagnoYsaturated(); } // Saturated Magnocellular output /** * @return the magnocellular moving contours ON information (motion), should be used at the parafovea level without post-processing */ - inline const std::valarray &getMovingContoursON() const {return _MagnoRetinaFilter.getMagnoON();};// Magnocellular ON output + inline const std::valarray &getMovingContoursON() const {return _MagnoRetinaFilter.getMagnoON(); } // Magnocellular ON output /** * @return the magnocellular moving contours OFF information (motion), should be used at the parafovea level without post-processing */ - inline const std::valarray &getMovingContoursOFF() const {return _MagnoRetinaFilter.getMagnoOFF();};// Magnocellular OFF output + inline const std::valarray &getMovingContoursOFF() const {return _MagnoRetinaFilter.getMagnoOFF(); } // Magnocellular OFF output /** * @return a gray level image with center Parvo and peripheral Magno X channels, WARNING, the result will be ok if you called previously fucntion runFilter(imageInput, processRetinaParvoMagnoMapping=true); * -> will be accessible even if color mode is activated (but the image is color sampled so quality is poor), but get the same thing but in color by the use of function getParvoColor() */ - inline const std::valarray &getRetinaParvoMagnoMappedOutput() const {return _retinaParvoMagnoMappedFrame;};// return image with center Parvo and peripheral Magno channels + inline const std::valarray &getRetinaParvoMagnoMappedOutput() const {return _retinaParvoMagnoMappedFrame; } // return image with center Parvo and peripheral Magno channels /** * color processing dedicated functions * @return the parvo channel (contours, details) of the processed frame, grayscale output */ - inline const std::valarray &getParvoContoursChannel() const {return _colorEngine.getLuminance();}; + inline const std::valarray &getParvoContoursChannel() const {return _colorEngine.getLuminance(); } /** * color processing dedicated functions * @return the chrominance of the processed frame (same colorspace as the input output, usually RGB) */ - inline const std::valarray &getParvoChrominance() const {return _colorEngine.getChrominance();}; // only retreive chrominance + inline const std::valarray &getParvoChrominance() const {return _colorEngine.getChrominance(); } // only retreive chrominance /** * color processing dedicated functions * @return the parvo + chrominance channels of the processed frame (same colorspace as the input output, usually RGB) */ - inline const std::valarray &getColorOutput() const {return _colorEngine.getDemultiplexedColorFrame();};// retrieve luminance+chrominance + inline const std::valarray &getColorOutput() const {return _colorEngine.getDemultiplexedColorFrame(); } // retrieve luminance+chrominance /** * apply to the retina color output the Krauskopf transformation which leads to an opponent color system: output colorspace if Acr1cr2 if input of the retina was LMS color space * @param result: the input buffer to fill with the transformed colorspace retina output * @return true if process ended successfully */ - inline bool applyKrauskopfLMS2Acr1cr2Transform(std::valarray &result){return _colorEngine.applyKrauskopfLMS2Acr1cr2Transform(result);}; + inline bool applyKrauskopfLMS2Acr1cr2Transform(std::valarray &result) { return _colorEngine.applyKrauskopfLMS2Acr1cr2Transform(result); } /** * apply to the retina color output the Krauskopf transformation which leads to an opponent color system: output colorspace if Acr1cr2 if input of the retina was LMS color space * @param result: the input buffer to fill with the transformed colorspace retina output * @return true if process ended successfully */ - inline bool applyLMS2LabTransform(std::valarray &result){return _colorEngine.applyLMS2LabTransform(result);}; + inline bool applyLMS2LabTransform(std::valarray &result) { return _colorEngine.applyLMS2LabTransform(result); } /** * color processing dedicated functions * @return the retina initialized mode, true if color mode (RGB), false if grayscale */ - inline bool isColorMode(){return _useColorMode;}; // return true if RGB mode, false if gray level mode + inline bool isColorMode() { return _useColorMode; } // return true if RGB mode, false if gray level mode /** * @return the irregular low pass filter ouput at the photoreceptors level */ - inline const std::valarray &getIrregularLPfilteredInputFrame() const {return _photoreceptorsLogSampling->getIrregularLPfilteredInputFrame();}; + inline const std::valarray &getIrregularLPfilteredInputFrame() const {return _photoreceptorsLogSampling->getIrregularLPfilteredInputFrame(); } /** * @return true if color mode is activated, false if gray levels processing */ - bool getColorMode(){return _useColorMode;}; + bool getColorMode() { return _useColorMode; } /** * * @return true if a sufficient number of processed frames has been done since the last parameters update in order to get the stable state (r�gime permanent) */ - inline bool isInitTransitionDone(){if (_ellapsedFramesSinceLastReset<_globalTemporalConstant)return false; return true;}; + inline bool isInitTransitionDone() { if (_ellapsedFramesSinceLastReset<_globalTemporalConstant)return false; return true; } /** * find a distance in the image input space when the distance is known in the retina log sampled space...read again if it is not clear enough....sorry, i should sleep @@ -467,7 +467,7 @@ public: if (_photoreceptorsLogSampling) return (float)_photoreceptorsLogSampling->getOriginalRadiusLength(projectedRadiusLength); return projectedRadiusLength; - }; + } /////////////////: // retina dimensions getters @@ -475,32 +475,32 @@ public: /** * @return number of rows of the filter */ - inline unsigned int getInputNBrows(){if (_photoreceptorsLogSampling) return _photoreceptorsLogSampling->getNBrows();else return _photoreceptorsPrefilter.getNBrows();}; + inline unsigned int getInputNBrows() { if (_photoreceptorsLogSampling) return _photoreceptorsLogSampling->getNBrows();else return _photoreceptorsPrefilter.getNBrows(); } /** * @return number of columns of the filter */ - inline unsigned int getInputNBcolumns(){if (_photoreceptorsLogSampling) return _photoreceptorsLogSampling->getNBcolumns();else return _photoreceptorsPrefilter.getNBcolumns();}; + inline unsigned int getInputNBcolumns() { if (_photoreceptorsLogSampling) return _photoreceptorsLogSampling->getNBcolumns();else return _photoreceptorsPrefilter.getNBcolumns(); } /** * @return number of pixels of the filter */ - inline unsigned int getInputNBpixels(){if (_photoreceptorsLogSampling) return _photoreceptorsLogSampling->getNBpixels();else return _photoreceptorsPrefilter.getNBpixels();}; + inline unsigned int getInputNBpixels() { if (_photoreceptorsLogSampling) return _photoreceptorsLogSampling->getNBpixels();else return _photoreceptorsPrefilter.getNBpixels(); } /** * @return the height of the frame output */ - inline unsigned int getOutputNBrows(){return _photoreceptorsPrefilter.getNBrows();}; + inline unsigned int getOutputNBrows() { return _photoreceptorsPrefilter.getNBrows(); } /** * @return the width of the frame output */ - inline unsigned int getOutputNBcolumns(){return _photoreceptorsPrefilter.getNBcolumns();}; + inline unsigned int getOutputNBcolumns() { return _photoreceptorsPrefilter.getNBcolumns(); } /** * @return the numbers of output pixels (width*height) of the images used by the object */ - inline unsigned int getOutputNBpixels(){return _photoreceptorsPrefilter.getNBpixels();}; + inline unsigned int getOutputNBpixels() { return _photoreceptorsPrefilter.getNBpixels(); } private: diff --git a/modules/bioinspired/src/templatebuffer.hpp b/modules/bioinspired/src/templatebuffer.hpp index 827eb709f..a95102d5c 100644 --- a/modules/bioinspired/src/templatebuffer.hpp +++ b/modules/bioinspired/src/templatebuffer.hpp @@ -92,7 +92,7 @@ private: public: Parallel_clipBufferValues(type* bufferToProcess, const type min, const type max) - : bufferToClip(bufferToProcess), minValue(min), maxValue(max){} + : bufferToClip(bufferToProcess), minValue(min), maxValue(max) { } virtual void operator()( const cv::Range &r ) const { register type *inputOutputBufferPTR=bufferToClip+r.start; @@ -194,32 +194,32 @@ public: /** * delete the buffer content (set zeros) */ - inline void setZero(){std::valarray::operator=(0);};//memset(Buffer(), 0, sizeof(type)*_NBpixels);}; + inline void setZero() { std::valarray::operator=(0); } //memset(Buffer(), 0, sizeof(type)*_NBpixels); } /** * @return the numbers of rows (height) of the images used by the object */ - inline unsigned int getNBrows(){return (unsigned int)_NBrows;}; + inline unsigned int getNBrows() { return (unsigned int)_NBrows; } /** * @return the numbers of columns (width) of the images used by the object */ - inline unsigned int getNBcolumns(){return (unsigned int)_NBcolumns;}; + inline unsigned int getNBcolumns() { return (unsigned int)_NBcolumns; } /** * @return the numbers of pixels (width*height) of the images used by the object */ - inline unsigned int getNBpixels(){return (unsigned int)_NBpixels;}; + inline unsigned int getNBpixels() { return (unsigned int)_NBpixels; } /** * @return the numbers of pixels (width*height) of the images used by the object */ - inline unsigned int getDoubleNBpixels(){return (unsigned int)_doubleNBpixels;}; + inline unsigned int getDoubleNBpixels() { return (unsigned int)_doubleNBpixels; } /** * @return the numbers of depths (3rd dimension: 1 for gray images, 3 for rgb images) of the images used by the object */ - inline unsigned int getDepthSize(){return (unsigned int)_NBdepths;}; + inline unsigned int getDepthSize() { return (unsigned int)_NBdepths; } /** * resize the buffer and recompute table index etc. @@ -275,7 +275,7 @@ public: * @param nbPixels: specifies the number of pixel on which the normalization should be performed, if 0, then all pixels specified in the constructor are processed * @param maxOutputValue: the maximum output value */ - void normalizeGrayOutput_0_maxOutputValue(const type maxOutputValue=(type)255.0){normalizeGrayOutput_0_maxOutputValue(this->Buffer(), this->size(), maxOutputValue);}; + void normalizeGrayOutput_0_maxOutputValue(const type maxOutputValue=(type)255.0) { normalizeGrayOutput_0_maxOutputValue(this->Buffer(), this->size(), maxOutputValue); } /** * sigmoide image normalization function (saturates min and max values) @@ -293,7 +293,7 @@ public: * @param sensitivity: strenght of the sigmoide * @param maxOutputValue: the maximum output value */ - inline void normalizeGrayOutputCentredSigmoide(const type meanValue=(type)0.0, const type sensitivity=(type)2.0, const type maxOutputValue=(type)255.0){ (void)maxOutputValue; normalizeGrayOutputCentredSigmoide(meanValue, sensitivity, 255.0, this->Buffer(), this->Buffer(), this->getNBpixels());}; + inline void normalizeGrayOutputCentredSigmoide(const type meanValue=(type)0.0, const type sensitivity=(type)2.0, const type maxOutputValue=(type)255.0) { (void)maxOutputValue; normalizeGrayOutputCentredSigmoide(meanValue, sensitivity, 255.0, this->Buffer(), this->Buffer(), this->getNBpixels()); } /** * sigmoide image normalization function (saturates min and max values), in this function, the sigmoide is centered on low values (high saturation of the medium and high values @@ -325,7 +325,7 @@ public: standardDeviation+=diff*diff; } return std::sqrt(standardDeviation/this->size()); - }; + } /** * Clip buffer histogram @@ -409,7 +409,7 @@ public: /** * @return the mean value of the vector */ - inline double getMean(){return this->sum()/this->size();}; + inline double getMean() { return this->sum()/this->size(); } protected: size_t _NBrows; diff --git a/modules/calib3d/src/levmarq.cpp b/modules/calib3d/src/levmarq.cpp index 55704132c..d3eb7b556 100644 --- a/modules/calib3d/src/levmarq.cpp +++ b/modules/calib3d/src/levmarq.cpp @@ -80,7 +80,7 @@ namespace cv class LMSolverImpl : public LMSolver { public: - LMSolverImpl() : maxIters(100) { init(); }; + LMSolverImpl() : maxIters(100) { init(); } LMSolverImpl(const Ptr& _cb, int _maxIters) : cb(_cb), maxIters(_maxIters) { init(); } void init() @@ -215,7 +215,7 @@ CV_INIT_ALGORITHM(LMSolverImpl, "LMSolver", obj.info()->addParam(obj, "epsx", obj.epsx); obj.info()->addParam(obj, "epsf", obj.epsf); obj.info()->addParam(obj, "maxIters", obj.maxIters); - obj.info()->addParam(obj, "printInterval", obj.printInterval)); + obj.info()->addParam(obj, "printInterval", obj.printInterval)) Ptr createLMSolver(const Ptr& cb, int maxIters) { diff --git a/modules/calib3d/src/ptsetreg.cpp b/modules/calib3d/src/ptsetreg.cpp index aa361a911..1bf35ebc1 100644 --- a/modules/calib3d/src/ptsetreg.cpp +++ b/modules/calib3d/src/ptsetreg.cpp @@ -386,11 +386,11 @@ public: CV_INIT_ALGORITHM(RANSACPointSetRegistrator, "PointSetRegistrator.RANSAC", obj.info()->addParam(obj, "threshold", obj.threshold); obj.info()->addParam(obj, "confidence", obj.confidence); - obj.info()->addParam(obj, "maxIters", obj.maxIters)); + obj.info()->addParam(obj, "maxIters", obj.maxIters)) CV_INIT_ALGORITHM(LMeDSPointSetRegistrator, "PointSetRegistrator.LMeDS", obj.info()->addParam(obj, "confidence", obj.confidence); - obj.info()->addParam(obj, "maxIters", obj.maxIters)); + obj.info()->addParam(obj, "maxIters", obj.maxIters)) Ptr createRANSACPointSetRegistrator(const Ptr& _cb, int _modelPoints, double _threshold, diff --git a/modules/calib3d/test/test_cameracalibration_badarg.cpp b/modules/calib3d/test/test_cameracalibration_badarg.cpp index 3edab8bec..f8443d1ec 100644 --- a/modules/calib3d/test/test_cameracalibration_badarg.cpp +++ b/modules/calib3d/test/test_cameracalibration_badarg.cpp @@ -55,7 +55,7 @@ public: ~CV_CameraCalibrationBadArgTest() {} protected: void run(int); - void run_func(void) {}; + void run_func(void) {} const static int M = 1; @@ -334,7 +334,7 @@ public: CV_Rodrigues2BadArgTest() {} ~CV_Rodrigues2BadArgTest() {} protected: - void run_func(void) {}; + void run_func(void) {} struct C_Caller { @@ -459,10 +459,10 @@ public: Size imsSize(800, 600); camMat << 300.f, 0.f, imsSize.width/2.f, 0, 300.f, imsSize.height/2.f, 0.f, 0.f, 1.f; distCoeffs << 1.2f, 0.2f, 0.f, 0.f, 0.f; - }; - ~CV_ProjectPoints2BadArgTest() {} ; + } + ~CV_ProjectPoints2BadArgTest() {} protected: - void run_func(void) {}; + void run_func(void) {} Mat_ camMat; Mat_ distCoeffs; diff --git a/modules/contrib/include/opencv2/contrib.hpp b/modules/contrib/include/opencv2/contrib.hpp index 75c6f3db0..f5a432315 100644 --- a/modules/contrib/include/opencv2/contrib.hpp +++ b/modules/contrib/include/opencv2/contrib.hpp @@ -523,7 +523,7 @@ public: // Initializes a LDA with num_components (default 0) and specifies how // samples are aligned (default dataAsRow=true). LDA(int num_components = 0) : - _num_components(num_components) {}; + _num_components(num_components) { } // Initializes and performs a Discriminant Analysis with Fisher's // Optimization Criterion on given data in src and corresponding labels @@ -561,7 +561,7 @@ public: Mat reconstruct(InputArray src); // Returns the eigenvectors of this LDA. - Mat eigenvectors() const { return _eigenvectors; }; + Mat eigenvectors() const { return _eigenvectors; } // Returns the eigenvalues of this LDA. Mat eigenvalues() const { return _eigenvalues; } diff --git a/modules/core/include/opencv2/core/ocl.hpp b/modules/core/include/opencv2/core/ocl.hpp index e3805bcdc..fb9f0282b 100644 --- a/modules/core/include/opencv2/core/ocl.hpp +++ b/modules/core/include/opencv2/core/ocl.hpp @@ -221,7 +221,7 @@ public: void* ptr() const; struct Impl; - inline struct Impl* _getImpl() const { return p; }; + inline struct Impl* _getImpl() const { return p; } protected: Impl* p; }; @@ -242,7 +242,7 @@ public: static Platform& getDefault(); struct Impl; - inline struct Impl* _getImpl() const { return p; }; + inline struct Impl* _getImpl() const { return p; } protected: Impl* p; }; diff --git a/modules/core/src/arithm.cpp b/modules/core/src/arithm.cpp index f93d56fde..d176e3263 100644 --- a/modules/core/src/arithm.cpp +++ b/modules/core/src/arithm.cpp @@ -251,16 +251,16 @@ void vBinOp64(const T* src1, size_t step1, const T* src2, size_t step2, template <> \ struct name{ \ typedef register_type reg_type; \ - static reg_type load(const template_arg * p) { return load_body ((const reg_type *)p);}; \ - static void store(template_arg * p, reg_type v) { store_body ((reg_type *)p, v);}; \ + static reg_type load(const template_arg * p) { return load_body ((const reg_type *)p); } \ + static void store(template_arg * p, reg_type v) { store_body ((reg_type *)p, v); } \ } #define FUNCTOR_LOADSTORE(name, template_arg, register_type, load_body, store_body)\ template <> \ struct name{ \ typedef register_type reg_type; \ - static reg_type load(const template_arg * p) { return load_body (p);}; \ - static void store(template_arg * p, reg_type v) { store_body (p, v);}; \ + static reg_type load(const template_arg * p) { return load_body (p); } \ + static void store(template_arg * p, reg_type v) { store_body (p, v); } \ } #define FUNCTOR_CLOSURE_2arg(name, template_arg, body)\ diff --git a/modules/core/src/glob.cpp b/modules/core/src/glob.cpp index c75bd2e66..93dc72ff8 100644 --- a/modules/core/src/glob.cpp +++ b/modules/core/src/glob.cpp @@ -64,7 +64,7 @@ namespace HANDLE handle; dirent ent; #ifdef HAVE_WINRT - DIR() {}; + DIR() { } ~DIR() { if (ent.d_name) diff --git a/modules/core/src/ocl.cpp b/modules/core/src/ocl.cpp index cf3b1dcab..e35c7c944 100644 --- a/modules/core/src/ocl.cpp +++ b/modules/core/src/ocl.cpp @@ -1928,7 +1928,7 @@ inline cl_int getStringInfo(Functor f, ObjectType obj, cl_uint name, std::string } return CL_SUCCESS; -}; +} static void split(const std::string &s, char delim, std::vector &elems) { elems.clear(); diff --git a/modules/core/test/test_io.cpp b/modules/core/test/test_io.cpp index ba6656761..23c0aad62 100644 --- a/modules/core/test/test_io.cpp +++ b/modules/core/test/test_io.cpp @@ -83,7 +83,7 @@ static bool cvTsCheckSparse(const CvSparseMat* m1, const CvSparseMat* m2, double class Core_IOTest : public cvtest::BaseTest { public: - Core_IOTest() {}; + Core_IOTest() { } protected: void run(int) { diff --git a/modules/core/test/test_mat.cpp b/modules/core/test/test_mat.cpp index 3c8ae8bf9..6d72f9ea2 100644 --- a/modules/core/test/test_mat.cpp +++ b/modules/core/test/test_mat.cpp @@ -9,7 +9,7 @@ using namespace std; class Core_ReduceTest : public cvtest::BaseTest { public: - Core_ReduceTest() {}; + Core_ReduceTest() {} protected: void run( int); int checkOp( const Mat& src, int dstType, int opType, const Mat& opRes, int dim ); diff --git a/modules/core/test/test_operations.cpp b/modules/core/test/test_operations.cpp index 8d3341e59..8215ea93f 100644 --- a/modules/core/test/test_operations.cpp +++ b/modules/core/test/test_operations.cpp @@ -63,7 +63,7 @@ protected: struct test_excep { - test_excep(const string& _s=string("")) : s(_s) {}; + test_excep(const string& _s=string("")) : s(_s) { } string s; }; diff --git a/modules/core/test/test_umat.cpp b/modules/core/test/test_umat.cpp index 1dfe1d79a..cfea5c593 100644 --- a/modules/core/test/test_umat.cpp +++ b/modules/core/test/test_umat.cpp @@ -59,7 +59,7 @@ protected: struct test_excep { - test_excep(const string& _s=string("")) : s(_s) {}; + test_excep(const string& _s=string("")) : s(_s) { } string s; }; diff --git a/modules/cuda/src/cuda/ccomponetns.cu b/modules/cuda/src/cuda/ccomponetns.cu index 681ca8fe4..441413c34 100644 --- a/modules/cuda/src/cuda/ccomponetns.cu +++ b/modules/cuda/src/cuda/ccomponetns.cu @@ -133,7 +133,7 @@ namespace cv { namespace cuda { namespace device template struct InInterval { typedef typename VecTraits::elem_type E; - __host__ __device__ __forceinline__ InInterval(const float4& _lo, const float4& _hi) : lo((E)(-_lo.x)), hi((E)_hi.x) {}; + __host__ __device__ __forceinline__ InInterval(const float4& _lo, const float4& _hi) : lo((E)(-_lo.x)), hi((E)_hi.x) { } T lo, hi; template __device__ __forceinline__ bool operator() (const I& a, const I& b) const @@ -148,7 +148,7 @@ namespace cv { namespace cuda { namespace device { typedef typename VecTraits::elem_type E; __host__ __device__ __forceinline__ InInterval(const float4& _lo, const float4& _hi) - : lo (VecTraits::make((E)(-_lo.x), (E)(-_lo.y), (E)(-_lo.z))), hi (VecTraits::make((E)_hi.x, (E)_hi.y, (E)_hi.z)){}; + : lo (VecTraits::make((E)(-_lo.x), (E)(-_lo.y), (E)(-_lo.z))), hi (VecTraits::make((E)_hi.x, (E)_hi.y, (E)_hi.z)) { } T lo, hi; template __device__ __forceinline__ bool operator() (const I& a, const I& b) const @@ -164,7 +164,7 @@ namespace cv { namespace cuda { namespace device { typedef typename VecTraits::elem_type E; __host__ __device__ __forceinline__ InInterval(const float4& _lo, const float4& _hi) - : lo (VecTraits::make((E)(-_lo.x), (E)(-_lo.y), (E)(-_lo.z), (E)(-_lo.w))), hi (VecTraits::make((E)_hi.x, (E)_hi.y, (E)_hi.z, (E)_hi.w)){}; + : lo (VecTraits::make((E)(-_lo.x), (E)(-_lo.y), (E)(-_lo.z), (E)(-_lo.w))), hi (VecTraits::make((E)_hi.x, (E)_hi.y, (E)_hi.z, (E)_hi.w)) { } T lo, hi; template __device__ __forceinline__ bool operator() (const I& a, const I& b) const diff --git a/modules/cuda/test/test_labeling.cpp b/modules/cuda/test/test_labeling.cpp index fd6bfd631..8bc620aef 100644 --- a/modules/cuda/test/test_labeling.cpp +++ b/modules/cuda/test/test_labeling.cpp @@ -62,7 +62,7 @@ namespace struct InInterval { - InInterval(const int& _lo, const int& _hi) : lo(-_lo), hi(_hi) {}; + InInterval(const int& _lo, const int& _hi) : lo(-_lo), hi(_hi) {} const int lo, hi; bool operator() (const unsigned char a, const unsigned char b) const diff --git a/modules/cudalegacy/src/cuda/NCVPixelOperations.hpp b/modules/cudalegacy/src/cuda/NCVPixelOperations.hpp index e094f6bc0..2d06cda85 100644 --- a/modules/cudalegacy/src/cuda/NCVPixelOperations.hpp +++ b/modules/cudalegacy/src/cuda/NCVPixelOperations.hpp @@ -104,7 +104,7 @@ template<> struct TConvBase2Vec {typedef double3 TVec;}; template<> struct TConvBase2Vec {typedef double4 TVec;}; //TODO: consider using CUDA intrinsics to avoid branching -template static inline __host__ __device__ void _TDemoteClampZ(Tin &a, Ncv8u &out) {out = (Ncv8u)CLAMP_0_255(a);}; +template static inline __host__ __device__ void _TDemoteClampZ(Tin &a, Ncv8u &out) {out = (Ncv8u)CLAMP_0_255(a);} template static inline __host__ __device__ void _TDemoteClampZ(Tin &a, Ncv16u &out) {out = (Ncv16u)CLAMP(a, 0, USHRT_MAX);} template static inline __host__ __device__ void _TDemoteClampZ(Tin &a, Ncv32u &out) {out = (Ncv32u)CLAMP(a, 0, UINT_MAX);} template static inline __host__ __device__ void _TDemoteClampZ(Tin &a, Ncv32f &out) {out = (Ncv32f)a;} diff --git a/modules/flann/include/opencv2/flann/autotuned_index.h b/modules/flann/include/opencv2/flann/autotuned_index.h index 8d531753e..b0beac499 100644 --- a/modules/flann/include/opencv2/flann/autotuned_index.h +++ b/modules/flann/include/opencv2/flann/autotuned_index.h @@ -270,7 +270,7 @@ private: // struct KMeansSimpleDownhillFunctor { // // Autotune& autotuner; - // KMeansSimpleDownhillFunctor(Autotune& autotuner_) : autotuner(autotuner_) {}; + // KMeansSimpleDownhillFunctor(Autotune& autotuner_) : autotuner(autotuner_) {} // // float operator()(int* params) { // @@ -295,7 +295,7 @@ private: // struct KDTreeSimpleDownhillFunctor { // // Autotune& autotuner; - // KDTreeSimpleDownhillFunctor(Autotune& autotuner_) : autotuner(autotuner_) {}; + // KDTreeSimpleDownhillFunctor(Autotune& autotuner_) : autotuner(autotuner_) {} // // float operator()(int* params) { // float maxFloat = numeric_limits::max(); diff --git a/modules/flann/test/test_lshtable_badarg.cpp b/modules/flann/test/test_lshtable_badarg.cpp index 3b776668d..4c9ebf9fe 100644 --- a/modules/flann/test/test_lshtable_badarg.cpp +++ b/modules/flann/test/test_lshtable_badarg.cpp @@ -47,7 +47,7 @@ class CV_LshTableBadArgTest : public cvtest::BadArgTest { protected: void run(int); - void run_func(void) {}; + void run_func(void) { } struct Caller { diff --git a/modules/highgui/src/cap_ios_video_camera.mm b/modules/highgui/src/cap_ios_video_camera.mm index 99f8a75ae..20973c313 100644 --- a/modules/highgui/src/cap_ios_video_camera.mm +++ b/modules/highgui/src/cap_ios_video_camera.mm @@ -34,7 +34,7 @@ #import -static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;}; +static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;} #pragma mark - Private Interface diff --git a/modules/highgui/src/grfmt_base.hpp b/modules/highgui/src/grfmt_base.hpp index f7fde90cf..8a534daa8 100644 --- a/modules/highgui/src/grfmt_base.hpp +++ b/modules/highgui/src/grfmt_base.hpp @@ -59,11 +59,11 @@ class BaseImageDecoder { public: BaseImageDecoder(); - virtual ~BaseImageDecoder() {}; + virtual ~BaseImageDecoder() {} - int width() const { return m_width; }; - int height() const { return m_height; }; - virtual int type() const { return m_type; }; + int width() const { return m_width; } + int height() const { return m_height; } + virtual int type() const { return m_type; } virtual bool setSource( const String& filename ); virtual bool setSource( const Mat& buf ); @@ -90,7 +90,7 @@ class BaseImageEncoder { public: BaseImageEncoder(); - virtual ~BaseImageEncoder() {}; + virtual ~BaseImageEncoder() {} virtual bool isFormatSupported( int depth ) const; virtual bool setDestination( const String& filename ); diff --git a/modules/highgui/src/rgbe.cpp b/modules/highgui/src/rgbe.cpp index a28100a60..c35197daa 100644 --- a/modules/highgui/src/rgbe.cpp +++ b/modules/highgui/src/rgbe.cpp @@ -79,7 +79,7 @@ enum rgbe_error_codes { rgbe_read_error, rgbe_write_error, rgbe_format_error, - rgbe_memory_error, + rgbe_memory_error }; /* default error routine. change this to change error handling */ diff --git a/modules/highgui/test/test_positioning.cpp b/modules/highgui/test/test_positioning.cpp index edc8dcf42..993a76cb4 100644 --- a/modules/highgui/test/test_positioning.cpp +++ b/modules/highgui/test/test_positioning.cpp @@ -67,7 +67,7 @@ private: class CV_VideoProgressivePositioningTest: public CV_VideoPositioningTest { public: - CV_VideoProgressivePositioningTest() : CV_VideoPositioningTest() {}; + CV_VideoProgressivePositioningTest() : CV_VideoPositioningTest() { } ~CV_VideoProgressivePositioningTest(); void run(int); }; @@ -75,7 +75,7 @@ public: class CV_VideoRandomPositioningTest: public CV_VideoPositioningTest { public: - CV_VideoRandomPositioningTest(): CV_VideoPositioningTest() {}; + CV_VideoRandomPositioningTest(): CV_VideoPositioningTest() { } ~CV_VideoRandomPositioningTest(); void run(int); }; diff --git a/modules/imgproc/include/opencv2/imgproc.hpp b/modules/imgproc/include/opencv2/imgproc.hpp index 5a9450bf2..2b94e0de2 100644 --- a/modules/imgproc/include/opencv2/imgproc.hpp +++ b/modules/imgproc/include/opencv2/imgproc.hpp @@ -952,7 +952,7 @@ public: */ CV_WRAP virtual int compareSegments(const Size& size, InputArray lines1, InputArray lines2, InputOutputArray _image = noArray()) = 0; - virtual ~LineSegmentDetector() {}; + virtual ~LineSegmentDetector() { } }; //! Returns a pointer to a LineSegmentDetector class. diff --git a/modules/imgproc/src/color.cpp b/modules/imgproc/src/color.cpp index 70ad0827c..1346f0a15 100644 --- a/modules/imgproc/src/color.cpp +++ b/modules/imgproc/src/color.cpp @@ -3658,7 +3658,7 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) int ustepIdx = 0; int vstepIdx = dstSz.height % 4 == 2 ? 1 : 0; - if(uIdx == 1) { std::swap(u ,v), std::swap(ustepIdx, vstepIdx); }; + if(uIdx == 1) { std::swap(u ,v), std::swap(ustepIdx, vstepIdx); } switch(dcn*10 + bIdx) { diff --git a/modules/imgproc/src/min_enclosing_triangle.cpp b/modules/imgproc/src/min_enclosing_triangle.cpp index 98bfd46e5..fb94fa0ba 100644 --- a/modules/imgproc/src/min_enclosing_triangle.cpp +++ b/modules/imgproc/src/min_enclosing_triangle.cpp @@ -287,7 +287,7 @@ static void updateSidesCA(const std::vector &polygon, cv::Point2f &sideAStartVertex, cv::Point2f &sideAEndVertex, cv::Point2f &sideCStartVertex, cv::Point2f &sideCEndVertex); -}; +} ///////////////////////////////////// Main functions ///////////////////////////////////// @@ -1560,4 +1560,4 @@ static bool lessOrEqual(double number1, double number2) { return ((number1 < number2) || (almostEqual(number1, number2))); } -}; \ No newline at end of file +} diff --git a/modules/imgproc/test/test_filter.cpp b/modules/imgproc/test/test_filter.cpp index efbad9974..f47e523d8 100644 --- a/modules/imgproc/test/test_filter.cpp +++ b/modules/imgproc/test/test_filter.cpp @@ -898,8 +898,8 @@ struct median_pair { int col; int val; - median_pair() {}; - median_pair( int _col, int _val ) : col(_col), val(_val) {}; + median_pair() { } + median_pair( int _col, int _val ) : col(_col), val(_val) { } }; diff --git a/modules/imgproc/test/test_lsd.cpp b/modules/imgproc/test/test_lsd.cpp index 82f5b0bce..50a353503 100644 --- a/modules/imgproc/test/test_lsd.cpp +++ b/modules/imgproc/test/test_lsd.cpp @@ -12,7 +12,7 @@ const int EPOCHS = 20; class LSDBase : public testing::Test { public: - LSDBase() {}; + LSDBase() { } protected: Mat test_image; @@ -30,7 +30,7 @@ protected: class Imgproc_LSD_ADV: public LSDBase { public: - Imgproc_LSD_ADV() {}; + Imgproc_LSD_ADV() { } protected: }; @@ -38,7 +38,7 @@ protected: class Imgproc_LSD_STD: public LSDBase { public: - Imgproc_LSD_STD() {}; + Imgproc_LSD_STD() { } protected: }; @@ -46,7 +46,7 @@ protected: class Imgproc_LSD_NONE: public LSDBase { public: - Imgproc_LSD_NONE() {}; + Imgproc_LSD_NONE() { } protected: }; diff --git a/modules/legacy/src/blobtrackgen1.cpp b/modules/legacy/src/blobtrackgen1.cpp index 7114f2b4c..af9c3b3a1 100644 --- a/modules/legacy/src/blobtrackgen1.cpp +++ b/modules/legacy/src/blobtrackgen1.cpp @@ -98,7 +98,7 @@ public: m_pFileName = NULL; SetModuleName("Gen1"); - }; + } ~CvBlobTrackGen1() { @@ -119,7 +119,7 @@ public: } /* Check next track. */ } /* Destructor. */ - void SetFileName(char* pFileName){m_pFileName = pFileName;}; + void SetFileName(char* pFileName){m_pFileName = pFileName;} void AddBlob(CvBlob* pBlob) { @@ -140,7 +140,7 @@ public: pTrack->FrameLast = m_Frame; assert(pTrack->pSeq); pTrack->pSeq->AddBlob(pBlob); - }; + } void Process(IplImage* /*pImg*/ = NULL, IplImage* /*pFG*/ = NULL) { diff --git a/modules/legacy/src/blobtrackgenyml.cpp b/modules/legacy/src/blobtrackgenyml.cpp index 0d9de45ee..c33d16d03 100644 --- a/modules/legacy/src/blobtrackgenyml.cpp +++ b/modules/legacy/src/blobtrackgenyml.cpp @@ -147,7 +147,7 @@ public: m_Size = cvSize(2,2); SetModuleName("YML"); - }; + } ~CvBlobTrackGenYML() { @@ -164,7 +164,7 @@ public: } /* Destructor. */ - void SetFileName(char* pFileName){m_pFileName = pFileName;}; + void SetFileName(char* pFileName){m_pFileName = pFileName;} void AddBlob(CvBlob* pBlob) { DefBlobTrack* pTrack = (DefBlobTrack*)m_TrackList.GetBlobByID(CV_BLOB_ID(pBlob)); @@ -184,7 +184,7 @@ public: pTrack->FrameLast = m_Frame; assert(pTrack->pSeq); pTrack->pSeq->AddBlob(pBlob); - }; + } void Process(IplImage* pImg = NULL, IplImage* /*pFG*/ = NULL) { int i; diff --git a/modules/legacy/src/blobtrackingauto.cpp b/modules/legacy/src/blobtrackingauto.cpp index ada0bdff4..1fd695310 100644 --- a/modules/legacy/src/blobtrackingauto.cpp +++ b/modules/legacy/src/blobtrackingauto.cpp @@ -97,16 +97,16 @@ class CvBlobTrackerAuto1: public CvBlobTrackerAuto public: CvBlobTrackerAuto1(CvBlobTrackerAutoParam1* param); ~CvBlobTrackerAuto1(); - CvBlob* GetBlob(int index){return m_BlobList.GetBlob(index);}; - CvBlob* GetBlobByID(int ID){return m_BlobList.GetBlobByID(ID);}; - int GetBlobNum(){return m_BlobList.GetBlobNum();}; - virtual IplImage* GetFGMask(){return m_pFGMask;}; - float GetState(int BlobID){return m_pBTA?m_pBTA->GetState(BlobID):0;}; - const char* GetStateDesc(int BlobID){return m_pBTA?m_pBTA->GetStateDesc(BlobID):NULL;}; + CvBlob* GetBlob(int index){return m_BlobList.GetBlob(index);} + CvBlob* GetBlobByID(int ID){return m_BlobList.GetBlobByID(ID);} + int GetBlobNum(){return m_BlobList.GetBlobNum();} + virtual IplImage* GetFGMask(){return m_pFGMask;} + float GetState(int BlobID){return m_pBTA?m_pBTA->GetState(BlobID):0;} + const char* GetStateDesc(int BlobID){return m_pBTA?m_pBTA->GetStateDesc(BlobID):NULL;} /* Return 0 if trajectory is normal; return >0 if trajectory abnormal. */ void Process(IplImage* pImg, IplImage* pMask = NULL); - void Release(){delete this;}; + void Release(){delete this;} private: IplImage* m_pFGMask; diff --git a/modules/legacy/src/blobtrackingcc.cpp b/modules/legacy/src/blobtrackingcc.cpp index c2279a20b..1a72c7e47 100644 --- a/modules/legacy/src/blobtrackingcc.cpp +++ b/modules/legacy/src/blobtrackingcc.cpp @@ -125,23 +125,23 @@ public: CommentParam("ConfidenceType","Type of calculated Confidence (NearestBlob, AverFG, BC)"); SetModuleName("CC"); - }; + } ~CvBlobTrackerCC() { if(m_pMem)cvReleaseMemStorage(&m_pMem); - }; + } /* Blob functions: */ - virtual int GetBlobNum() {return m_BlobList.GetBlobNum();}; - virtual CvBlob* GetBlob(int BlobIndex){return m_BlobList.GetBlob(BlobIndex);}; + virtual int GetBlobNum() {return m_BlobList.GetBlobNum();} + virtual CvBlob* GetBlob(int BlobIndex){return m_BlobList.GetBlob(BlobIndex);} virtual void SetBlob(int BlobIndex, CvBlob* pBlob) { CvBlob* pB = m_BlobList.GetBlob(BlobIndex); if(pB) pB[0] = pBlob[0]; - }; + } - virtual CvBlob* GetBlobByID(int BlobID){return m_BlobList.GetBlobByID(BlobID);}; + virtual CvBlob* GetBlobByID(int BlobID){return m_BlobList.GetBlobByID(BlobID);} virtual void DelBlob(int BlobIndex) { DefBlobTracker* pBT = (DefBlobTracker*)m_BlobList.GetBlob(BlobIndex); @@ -156,7 +156,7 @@ public: } delete pBT->pBlobHyp; m_BlobList.DelBlob(BlobIndex); - }; + } #if 0 virtual void DelBlobByID(int BlobID) { @@ -166,7 +166,7 @@ public: m_BlobList.DelBlobByID(BlobID); }; #endif - virtual void Release(){delete this;}; + virtual void Release(){delete this;} /* Add new blob to track it and assign to this blob personal ID */ /* pBlob - pinter to structure with blob parameters (ID is ignored)*/ @@ -185,7 +185,7 @@ public: NewB.AverFG = pImgFG?CalcAverageMask(pB,pImgFG):0; m_BlobList.AddBlob((CvBlob*)&NewB); return m_BlobList.GetBlob(m_BlobList.GetBlobNum()-1); - }; + } virtual void Process(IplImage* pImg, IplImage* pImgFG = NULL) { @@ -390,7 +390,7 @@ public: pBlob[0] = pB[0]; pBlob->ID = ID; - }; + } virtual double GetConfidence(int BlobIndex, CvBlob* pBlob, IplImage* /*pImg*/, IplImage* pImgFG = NULL) { @@ -443,7 +443,7 @@ public: } /* Calculate sum of mask. */ return W; - }; + } virtual void UpdateBlob(int BlobIndex, CvBlob* /*pBlob*/, IplImage* /*pImg*/, IplImage* pImgFG = NULL) { @@ -455,7 +455,7 @@ public: { //pBT->AverFG = pBT->AverFG * (1-m_Alpha) + m_Alpha * CalcAverageMask(pBlob,pImgFG); } - }; + } virtual void ParamUpdate() { @@ -481,7 +481,7 @@ public: DefBlobTracker* pBT = (DefBlobTracker*)m_BlobList.GetBlob(BlobIdx); assert(pBT->pBlobHyp); return pBT->pBlobHyp->GetBlobNum(); - }; /* CvBlobtrackerList::GetBlobHypNum() */ + } /* CvBlobtrackerList::GetBlobHypNum() */ /* Return pointer to specified blob hypothesis by index blob: */ virtual CvBlob* GetBlobHyp(int BlobIndex, int hypothesis) @@ -489,7 +489,7 @@ public: DefBlobTracker* pBT = (DefBlobTracker*)m_BlobList.GetBlob(BlobIndex); assert(pBT->pBlobHyp); return pBT->pBlobHyp->GetBlob(hypothesis); - }; /* CvBlobtrackerList::GetBlobHyp() */ + } /* CvBlobtrackerList::GetBlobHyp() */ /* Set new parameters for specified (by index) blob hypothesis * (can be called several times for each hypothesis): @@ -512,7 +512,7 @@ public: assert(pBT->pBlobHyp); pBT->pBlobHyp->AddBlob(pBlob); } - }; + } private: CvBlob* GetNearestBlob(CvBlob* pB) @@ -542,7 +542,7 @@ private: return pBBest; - }; /* GetNearestBlob */ + } /* GetNearestBlob */ }; diff --git a/modules/legacy/src/blobtrackingccwithcr.cpp b/modules/legacy/src/blobtrackingccwithcr.cpp index ad00b9438..e8bd4dec8 100644 --- a/modules/legacy/src/blobtrackingccwithcr.cpp +++ b/modules/legacy/src/blobtrackingccwithcr.cpp @@ -110,23 +110,23 @@ public: pM->Release(); } SetParam("SizeVar",0); - }; + } ~CvBlobTrackerCCCR() { if(m_pMem)cvReleaseMemStorage(&m_pMem); - }; + } /* Blob functions: */ - virtual int GetBlobNum() {return m_BlobList.GetBlobNum();}; - virtual CvBlob* GetBlob(int BlobIndex){return m_BlobList.GetBlob(BlobIndex);}; + virtual int GetBlobNum() {return m_BlobList.GetBlobNum();} + virtual CvBlob* GetBlob(int BlobIndex){return m_BlobList.GetBlob(BlobIndex);} virtual void SetBlob(int BlobIndex, CvBlob* pBlob) { CvBlob* pB = m_BlobList.GetBlob(BlobIndex); if(pB) pB[0] = pBlob[0]; - }; + } - virtual CvBlob* GetBlobByID(int BlobID){return m_BlobList.GetBlobByID(BlobID);}; + virtual CvBlob* GetBlobByID(int BlobID){return m_BlobList.GetBlobByID(BlobID);} virtual void DelBlob(int BlobIndex) { DefBlobTrackerCR* pBT = (DefBlobTrackerCR*)m_BlobList.GetBlob(BlobIndex); @@ -134,7 +134,7 @@ public: if(pBT->pPredictor)pBT->pPredictor->Release(); delete pBT->pBlobHyp; m_BlobList.DelBlob(BlobIndex); - }; + } virtual void DelBlobByID(int BlobID) { @@ -143,9 +143,9 @@ public: if(pBT->pPredictor)pBT->pPredictor->Release(); delete pBT->pBlobHyp; m_BlobList.DelBlobByID(BlobID); - }; + } - virtual void Release(){delete this;}; + virtual void Release(){delete this;} /* Add new blob to track it and assign to this blob personal ID */ /* pBlob - pinter to structure with blob parameters (ID is ignored)*/ @@ -169,7 +169,7 @@ public: } m_BlobList.AddBlob((CvBlob*)&NewB); return m_BlobList.GetBlob(m_BlobList.GetBlobNum()-1); - }; + } virtual void Process(IplImage* pImg, IplImage* pImgFG = NULL) { @@ -480,7 +480,7 @@ public: } /* Read next blob. */ } /* CCwithCR LoadState */ - //void SetCollision(int Collision){m_Collision = Collision;}; + //void SetCollision(int Collision){m_Collision = Collision;} }; CvBlobTrackerOne* cvCreateBlobTrackerOneMSPF(); diff --git a/modules/legacy/src/blobtrackinglist.cpp b/modules/legacy/src/blobtrackinglist.cpp index e48f6593f..cbf007186 100644 --- a/modules/legacy/src/blobtrackinglist.cpp +++ b/modules/legacy/src/blobtrackinglist.cpp @@ -228,7 +228,7 @@ public: { m_BlobTrackerList.DelBlob(i-1); } - }; + } CvBlob* AddBlob(CvBlob* pBlob, IplImage* pImg, IplImage* pImgFG ) { /* Create new tracker: */ @@ -244,7 +244,7 @@ public: F.pTracker->Init(pBlob,pImg, pImgFG); m_BlobTrackerList.AddBlob((CvBlob*)&F); return m_BlobTrackerList.GetBlob(m_BlobTrackerList.GetBlobNum()-1); - }; + } void DelBlob(int BlobIndex) { @@ -404,7 +404,7 @@ public: } /* Update predictor. */ #endif m_ClearHyp = 1; - }; + } /* Process on blob (for multi hypothesis tracing) */ @@ -421,7 +421,7 @@ public: pBlob[0] = pF->blob; } pBlob->ID = ID; - }; + } virtual double GetConfidence(int BlobIndex, CvBlob* pBlob, IplImage* pImg, IplImage* pImgFG = NULL) { @@ -429,7 +429,7 @@ public: if(pF==NULL) return 0; if(pF->pTracker==NULL) return 0; return pF->pTracker->GetConfidence(pBlob?pBlob:(&pF->blob), pImg, pImgFG, NULL); - }; + } virtual double GetConfidenceList(CvBlobSeq* pBlobList, IplImage* pImg, IplImage* pImgFG = NULL) { @@ -460,7 +460,7 @@ public: // cvWaitKey(0); } return W; - }; + } virtual void UpdateBlob(int BlobIndex, CvBlob* pBlob, IplImage* pImg, IplImage* /*pImgFG*/ = NULL) { @@ -469,10 +469,10 @@ public: { pF->pTracker->Update(pBlob?pBlob:&(pF->blob),pImg,m_pImgFG); } - }; + } - int GetBlobNum(){return m_BlobTrackerList.GetBlobNum();}; - CvBlob* GetBlob(int index){return m_BlobTrackerList.GetBlob(index);}; + int GetBlobNum(){return m_BlobTrackerList.GetBlobNum();} + CvBlob* GetBlob(int index){return m_BlobTrackerList.GetBlob(index);} void SetBlob(int BlobIndex, CvBlob* pBlob) { @@ -485,7 +485,7 @@ public: } } - void Release(){delete this;}; + void Release(){delete this;} /* Additional functionality: */ CvBlob* GetBlobByID(int BlobID){return m_BlobTrackerList.GetBlobByID(BlobID);} @@ -497,7 +497,7 @@ public: DefBlobTrackerL* pF = (DefBlobTrackerL*)m_BlobTrackerList.GetBlob(BlobIdx); assert(pF->pBlobHyp); return pF->pBlobHyp->GetBlobNum(); - }; /* CvBlobtrackerList::GetBlobHypNum() */ + } /* CvBlobtrackerList::GetBlobHypNum() */ /* Return pointer to specified blob hypothesis by index blob: */ virtual CvBlob* GetBlobHyp(int BlobIndex, int hypothesis) @@ -505,7 +505,7 @@ public: DefBlobTrackerL* pF = (DefBlobTrackerL*)m_BlobTrackerList.GetBlob(BlobIndex); assert(pF->pBlobHyp); return pF->pBlobHyp->GetBlob(hypothesis); - }; /* CvBlobtrackerList::GetBlobHyp() */ + } /* CvBlobtrackerList::GetBlobHyp() */ /* Set new parameters for specified (by index) blob hyp (can be called several times for each hyp )*/ virtual void SetBlobHyp(int BlobIndex, CvBlob* pBlob) @@ -526,7 +526,7 @@ public: assert(pF->pBlobHyp); pF->pBlobHyp->AddBlob(pBlob); } - }; /* CvBlobtrackerList::SetBlobHyp */ + } /* CvBlobtrackerList::SetBlobHyp */ private: public: diff --git a/modules/legacy/src/blobtrackingmsfg.cpp b/modules/legacy/src/blobtrackingmsfg.cpp index 5fd9634d4..a26ce029f 100644 --- a/modules/legacy/src/blobtrackingmsfg.cpp +++ b/modules/legacy/src/blobtrackingmsfg.cpp @@ -260,7 +260,7 @@ private: pHist->m_HistVolume = Volume; - }; /* CollectHist */ + } /* CollectHist */ double calcBhattacharyya(DefHist* pHM = NULL, DefHist* pHC = NULL, DefHist* pHT = NULL) { @@ -370,7 +370,7 @@ public: if(pImg) CollectHist(pImg, pImgFG, pBlobInit, &m_HistModel); m_Blob = pBlobInit[0]; - }; + } virtual CvBlob* Process(CvBlob* pBlobPrev, IplImage* pImg, IplImage* pImgFG = NULL) { @@ -603,7 +603,7 @@ public: return &m_Blob; - }; /* CvBlobTrackerOneMSFG::Process */ + } /* CvBlobTrackerOneMSFG::Process */ virtual double GetConfidence(CvBlob* pBlob, IplImage* pImg, IplImage* /*pImgFG*/ = NULL, IplImage* pImgUnusedReg = NULL) { @@ -611,14 +611,14 @@ public: double B = GetBhattacharyya(pImg, pImgUnusedReg, pBlob, &m_HistTemp); return exp((B-1)/(2*S)); - }; /*CvBlobTrackerOneMSFG::*/ + } /*CvBlobTrackerOneMSFG::*/ virtual void Update(CvBlob* pBlob, IplImage* pImg, IplImage* pImgFG = NULL) { /* Update histogram: */ UpdateModelHist(pImg, pImgFG, pBlob?pBlob:&m_Blob); } /*CvBlobTrackerOneMSFG::*/ - virtual void Release(){delete this;}; + virtual void Release(){delete this;} virtual void SetCollision(int CollisionFlag) { m_Collision = CollisionFlag; @@ -629,7 +629,7 @@ public: cvWriteInt(fs,"Collision", m_Collision); cvWriteInt(fs,"HistVolume", cvRound(m_HistModel.m_HistVolume)); cvWrite(fs,"Hist", m_HistModel.m_pHist); - }; + } virtual void LoadState(CvFileStorage* fs, CvFileNode* node) { CvMat* pM; @@ -641,7 +641,7 @@ public: m_HistModel.m_pHist = pM; m_HistModel.m_HistVolume = (float)cvSum(pM).val[0]; } - }; + } }; /*CvBlobTrackerOneMSFG*/ @@ -782,7 +782,7 @@ public: cvWriteInt(fs,"ParticleNum",m_ParticleNum); cvWriteStruct(fs,"ParticlesPredicted",m_pParticlesPredicted,"ffffiffd",m_ParticleNum); cvWriteStruct(fs,"ParticlesResampled",m_pParticlesResampled,"ffffiffd",m_ParticleNum); - }; + } virtual void LoadState(CvFileStorage* fs, CvFileNode* node) { @@ -796,7 +796,7 @@ public: cvReadStructByName(fs,node,"ParticlesPredicted",m_pParticlesPredicted,"ffffiffd"); cvReadStructByName(fs,node,"ParticlesResampled",m_pParticlesResampled,"ffffiffd"); } - }; + } CvBlobTrackerOneMSPF() { m_pParticlesPredicted = NULL; @@ -847,7 +847,7 @@ private: if(m_pParticlesPredicted)cvFree(&m_pParticlesPredicted); m_pParticlesPredicted = (DefParticle*)cvAlloc(sizeof(DefParticle)*m_ParticleNum); m_pParticlesResampled = (DefParticle*)cvAlloc(sizeof(DefParticle)*m_ParticleNum); - }; /* Realloc*/ + } /* Realloc*/ void DrawDebug(IplImage* pImg, IplImage* /*pImgFG*/) { @@ -1161,7 +1161,7 @@ public: } } - virtual void Release(){delete this;}; + virtual void Release(){delete this;} virtual void ParamUpdate() { Realloc(); diff --git a/modules/legacy/src/blobtrackingmsfgs.cpp b/modules/legacy/src/blobtrackingmsfgs.cpp index f3b3cf375..afe33847f 100644 --- a/modules/legacy/src/blobtrackingmsfgs.cpp +++ b/modules/legacy/src/blobtrackingmsfgs.cpp @@ -210,7 +210,7 @@ private: if(pHistVolume)pHistVolume[0] = Volume; - }; /* calcHist */ + } /* calcHist */ double calcBhattacharyya() { @@ -440,9 +440,9 @@ public: return &m_Blob; - }; /* Process */ + } /* Process */ - virtual void Release(){delete this;}; + virtual void Release(){delete this;} }; /*CvBlobTrackerOneMSFGS*/ static CvBlobTrackerOne* cvCreateBlobTrackerOneMSFGS() diff --git a/modules/legacy/src/blobtrackpostproclist.cpp b/modules/legacy/src/blobtrackpostproclist.cpp index 33e68fe46..ed03d8e58 100644 --- a/modules/legacy/src/blobtrackpostproclist.cpp +++ b/modules/legacy/src/blobtrackpostproclist.cpp @@ -74,7 +74,7 @@ public: DefBlobFilter* pF = (DefBlobFilter*)m_BlobFilterList.GetBlob(i-1); pF->pFilter->Release(); } - }; + } virtual void AddBlob(CvBlob* pBlob) { @@ -93,7 +93,7 @@ public: assert(pF); pF->blob = pBlob[0]; pF->m_LastFrame = m_Frame; - }; + } virtual void Process() { @@ -115,11 +115,11 @@ public: } } /* Next blob. */ m_Frame++; - }; + } - int GetBlobNum(){return m_BlobFilterList.GetBlobNum();}; - CvBlob* GetBlob(int index){return m_BlobFilterList.GetBlob(index);}; - void Release(){delete this;}; + int GetBlobNum(){return m_BlobFilterList.GetBlobNum();} + CvBlob* GetBlob(int index){return m_BlobFilterList.GetBlob(index);} + void Release(){delete this;} /* Additional functionality: */ CvBlob* GetBlobByID(int BlobID){return m_BlobFilterList.GetBlobByID(BlobID);} diff --git a/modules/legacy/src/enteringblobdetection.cpp b/modules/legacy/src/enteringblobdetection.cpp index a383bcf67..a488e0881 100644 --- a/modules/legacy/src/enteringblobdetection.cpp +++ b/modules/legacy/src/enteringblobdetection.cpp @@ -544,7 +544,7 @@ public: CvBlobDetectorCC(); ~CvBlobDetectorCC(); int DetectNewBlob(IplImage* pImg, IplImage* pFGMask, CvBlobSeq* pNewBlobList, CvBlobSeq* pOldBlobList); - void Release(){delete this;}; + void Release(){delete this;} virtual void ParamUpdate() { diff --git a/modules/legacy/src/enteringblobdetectionreal.cpp b/modules/legacy/src/enteringblobdetectionreal.cpp index 9458ab53e..01a1c7604 100644 --- a/modules/legacy/src/enteringblobdetectionreal.cpp +++ b/modules/legacy/src/enteringblobdetectionreal.cpp @@ -156,7 +156,7 @@ public: } /* cvDetectNewBlob */ - void Release(){delete this;}; + void Release(){delete this;} }; /* Blob detector constructor: */ diff --git a/modules/legacy/src/facetemplate.h b/modules/legacy/src/facetemplate.h index 31a3a8303..83f5bc30e 100644 --- a/modules/legacy/src/facetemplate.h +++ b/modules/legacy/src/facetemplate.h @@ -98,7 +98,7 @@ inline void FaceFeature::SetWeight(double dWeight) class FaceTemplate { public: - FaceTemplate(long lFeatureCount) {m_lFeturesCount = lFeatureCount; m_lpFeaturesList = new FaceFeature[lFeatureCount];}; + FaceTemplate(long lFeatureCount) {m_lFeturesCount = lFeatureCount; m_lpFeaturesList = new FaceFeature[lFeatureCount];} virtual ~FaceTemplate(); inline long GetCount(); diff --git a/modules/legacy/src/oneway.cpp b/modules/legacy/src/oneway.cpp index 43ded8593..5eac273f4 100644 --- a/modules/legacy/src/oneway.cpp +++ b/modules/legacy/src/oneway.cpp @@ -57,8 +57,8 @@ namespace cv{ cvCopy(translation, m_translation); }; - CvMat* GetRotation() {return m_rotation;}; - CvMat* GetTranslation() {return m_translation;}; + CvMat* GetRotation() {return m_rotation;} + CvMat* GetTranslation() {return m_translation;} protected: CvMat* m_rotation; diff --git a/modules/ml/include/opencv2/ml.hpp b/modules/ml/include/opencv2/ml.hpp index 7325aa075..aca013e09 100644 --- a/modules/ml/include/opencv2/ml.hpp +++ b/modules/ml/include/opencv2/ml.hpp @@ -515,7 +515,7 @@ public: CV_WRAP virtual int get_support_vector_count() const; virtual const float* get_support_vector(int i) const; - virtual CvSVMParams get_params() const { return params; }; + virtual CvSVMParams get_params() const { return params; } CV_WRAP virtual void clear(); static CvParamGrid get_default_grid( int param_id ); @@ -1523,7 +1523,7 @@ public: // API // virtual bool train( CvMLData* data, CvGBTreesParams params=CvGBTreesParams(), - bool update=false ) {return false;}; + bool update=false ) {return false;} // INPUT // data - training set. diff --git a/modules/objdetect/doc/erfilter.rst b/modules/objdetect/doc/erfilter.rst index a8976fbcd..85d6bcc7f 100644 --- a/modules/objdetect/doc/erfilter.rst +++ b/modules/objdetect/doc/erfilter.rst @@ -46,7 +46,7 @@ An ER is a 4-connected set of pixels with all its grey-level values smaller than //! Constructor explicit ERStat(int level = 256, int pixel = 0, int x = 0, int y = 0); //! Destructor - ~ERStat(){}; + ~ERStat() { } //! seed point and threshold (max grey-level value) int pixel; @@ -105,7 +105,7 @@ Base class for 1st and 2nd stages of Neumann and Matas scene text detection algo class CV_EXPORTS Callback { public: - virtual ~Callback(){}; + virtual ~Callback() { } //! The classifier must return probability measure for the region. virtual double eval(const ERStat& stat) = 0; }; diff --git a/modules/objdetect/include/opencv2/objdetect.hpp b/modules/objdetect/include/opencv2/objdetect.hpp index 0d5792124..b9ba2b935 100644 --- a/modules/objdetect/include/opencv2/objdetect.hpp +++ b/modules/objdetect/include/opencv2/objdetect.hpp @@ -190,7 +190,7 @@ public: public: virtual ~MaskGenerator() {} virtual Mat generateMask(const Mat& src)=0; - virtual void initializeMask(const Mat& /*src*/) {}; + virtual void initializeMask(const Mat& /*src*/) { } }; virtual void setMaskGenerator(const Ptr& maskGenerator) = 0; virtual Ptr getMaskGenerator() = 0; diff --git a/modules/objdetect/include/opencv2/objdetect/erfilter.hpp b/modules/objdetect/include/opencv2/objdetect/erfilter.hpp index 9dc919a41..d7e07d80d 100644 --- a/modules/objdetect/include/opencv2/objdetect/erfilter.hpp +++ b/modules/objdetect/include/opencv2/objdetect/erfilter.hpp @@ -67,7 +67,7 @@ public: //! Constructor explicit ERStat(int level = 256, int pixel = 0, int x = 0, int y = 0); //! Destructor - ~ERStat(){}; + ~ERStat() { } //! seed point and the threshold (max grey-level value) int pixel; @@ -123,7 +123,7 @@ public: class CV_EXPORTS Callback { public: - virtual ~Callback(){}; + virtual ~Callback() { } //! The classifier must return probability measure for the region. virtual double eval(const ERStat& stat) = 0; //const = 0; //TODO why cannot use const = 0 here? }; diff --git a/modules/objdetect/src/cascadedetect.hpp b/modules/objdetect/src/cascadedetect.hpp index ad96e5064..2d3f9064d 100644 --- a/modules/objdetect/src/cascadedetect.hpp +++ b/modules/objdetect/src/cascadedetect.hpp @@ -112,7 +112,7 @@ protected: struct Stump { - Stump() {}; + Stump() { } Stump(int _featureIdx, float _threshold, float _left, float _right) : featureIdx(_featureIdx), threshold(_threshold), left(_left), right(_right) {} diff --git a/modules/objdetect/src/erfilter.cpp b/modules/objdetect/src/erfilter.cpp index 52743afe9..43664645a 100644 --- a/modules/objdetect/src/erfilter.cpp +++ b/modules/objdetect/src/erfilter.cpp @@ -83,7 +83,7 @@ public: //Constructor ERFilterNM(); //Destructor - ~ERFilterNM() {}; + ~ERFilterNM() {} float minProbability; bool nonMaxSuppression; @@ -146,7 +146,7 @@ public: //Constructor ERClassifierNM1(const std::string& filename); // Destructor - ~ERClassifierNM1() {}; + ~ERClassifierNM1() {} // The classifier must return probability measure for the region. double eval(const ERStat& stat); @@ -162,7 +162,7 @@ public: //constructor ERClassifierNM2(const std::string& filename); // Destructor - ~ERClassifierNM2() {}; + ~ERClassifierNM2() {} // The classifier must return probability measure for the region. double eval(const ERStat& stat); @@ -933,14 +933,14 @@ ERStat* ERFilterNM::er_tree_nonmax_suppression ( ERStat * stat, ERStat *parent, void ERFilterNM::setCallback(const Ptr& cb) { classifier = cb; -}; +} void ERFilterNM::setMinArea(float _minArea) { CV_Assert( (_minArea >= 0) && (_minArea < maxArea) ); minArea = _minArea; return; -}; +} void ERFilterNM::setMaxArea(float _maxArea) { @@ -948,39 +948,39 @@ void ERFilterNM::setMaxArea(float _maxArea) CV_Assert(minArea < _maxArea); maxArea = _maxArea; return; -}; +} void ERFilterNM::setThresholdDelta(int _thresholdDelta) { CV_Assert( (_thresholdDelta > 0) && (_thresholdDelta <= 128) ); thresholdDelta = _thresholdDelta; return; -}; +} void ERFilterNM::setMinProbability(float _minProbability) { CV_Assert( (_minProbability >= 0.0) && (_minProbability <= 1.0) ); minProbability = _minProbability; return; -}; +} void ERFilterNM::setMinProbabilityDiff(float _minProbabilityDiff) { CV_Assert( (_minProbabilityDiff >= 0.0) && (_minProbabilityDiff <= 1.0) ); minProbabilityDiff = _minProbabilityDiff; return; -}; +} void ERFilterNM::setNonMaxSuppression(bool _nonMaxSuppression) { nonMaxSuppression = _nonMaxSuppression; return; -}; +} int ERFilterNM::getNumRejected() { return num_rejected_regions; -}; +} @@ -993,7 +993,7 @@ ERClassifierNM1::ERClassifierNM1(const std::string& filename) boost.load( filename.c_str(), "boost" ); else CV_Error(CV_StsBadArg, "Default classifier file not found!"); -}; +} double ERClassifierNM1::eval(const ERStat& stat) { @@ -1009,7 +1009,7 @@ double ERClassifierNM1::eval(const ERStat& stat) // Logistic Correction returns a probability value (in the range(0,1)) return (double)1-(double)1/(1+exp(-2*votes)); -}; +} // load default 2nd stage classifier if found @@ -1019,7 +1019,7 @@ ERClassifierNM2::ERClassifierNM2(const std::string& filename) boost.load( filename.c_str(), "boost" ); else CV_Error(CV_StsBadArg, "Default classifier file not found!"); -}; +} double ERClassifierNM2::eval(const ERStat& stat) { @@ -1036,7 +1036,7 @@ double ERClassifierNM2::eval(const ERStat& stat) // Logistic Correction returns a probability value (in the range(0,1)) return (double)1-(double)1/(1+exp(-2*votes)); -}; +} /*! @@ -2164,7 +2164,7 @@ public: unsigned char metric_; /// Constructor. - MaxMeaningfulClustering(unsigned char method, unsigned char metric){ method_=method; metric_=metric; }; + MaxMeaningfulClustering(unsigned char method, unsigned char metric){ method_=method; metric_=metric; } void operator()(double *data, unsigned int num, int dim, unsigned char method, unsigned char metric, vector< vector > *meaningful_clusters); diff --git a/modules/ocl/test/test_fft.cpp b/modules/ocl/test/test_fft.cpp index 1c2a1da47..ddc26e360 100644 --- a/modules/ocl/test/test_fft.cpp +++ b/modules/ocl/test/test_fft.cpp @@ -202,8 +202,8 @@ void static convolveDFT(const cv::Mat& A, const cv::Mat& B, cv::Mat& C, bool cco tempA(cv::Rect(0, 0, C.cols, C.rows)).copyTo(C); } -IMPLEMENT_PARAM_CLASS(KSize, int); -IMPLEMENT_PARAM_CLASS(Ccorr, bool); +IMPLEMENT_PARAM_CLASS(KSize, int) +IMPLEMENT_PARAM_CLASS(Ccorr, bool) PARAM_TEST_CASE(Convolve_DFT, cv::Size, KSize, Ccorr) { diff --git a/modules/photo/src/hdr_common.cpp b/modules/photo/src/hdr_common.cpp index 6b67a58e0..9a2d720e4 100644 --- a/modules/photo/src/hdr_common.cpp +++ b/modules/photo/src/hdr_common.cpp @@ -102,4 +102,4 @@ Mat linearResponse(int channels) return response; } -}; +} diff --git a/modules/photo/src/hdr_common.hpp b/modules/photo/src/hdr_common.hpp index b00227f90..26fb8e419 100644 --- a/modules/photo/src/hdr_common.hpp +++ b/modules/photo/src/hdr_common.hpp @@ -57,6 +57,6 @@ void mapLuminance(Mat src, Mat dst, Mat lum, Mat new_lum, float saturation); Mat RobertsonWeights(); Mat linearResponse(int channels); -}; +} #endif diff --git a/modules/softcascade/src/cuda_invoker.hpp b/modules/softcascade/src/cuda_invoker.hpp index 00b7fe4b9..81229dfb4 100644 --- a/modules/softcascade/src/cuda_invoker.hpp +++ b/modules/softcascade/src/cuda_invoker.hpp @@ -110,7 +110,7 @@ struct Detection Detection(){} __device_inline__ Detection(int _x, int _y, uchar _w, uchar _h, float c) - : x(static_cast(_x)), y(static_cast(_y)), w(_w), h(_h), confidence(c), kind(0) {}; + : x(static_cast(_x)), y(static_cast(_y)), w(_w), h(_h), confidence(c), kind(0) {} }; struct GK107PolicyX4 diff --git a/modules/softcascade/src/integral_channel_builder.cpp b/modules/softcascade/src/integral_channel_builder.cpp index 08f155e4c..540005b76 100644 --- a/modules/softcascade/src/integral_channel_builder.cpp +++ b/modules/softcascade/src/integral_channel_builder.cpp @@ -118,7 +118,7 @@ public: using cv::softcascade::ChannelFeatureBuilder; using cv::softcascade::ChannelFeature; -CV_INIT_ALGORITHM(HOG6MagLuv, "ChannelFeatureBuilder.HOG6MagLuv", ); +CV_INIT_ALGORITHM(HOG6MagLuv, "ChannelFeatureBuilder.HOG6MagLuv", ) ChannelFeatureBuilder::~ChannelFeatureBuilder() {} diff --git a/modules/softcascade/src/octave.cpp b/modules/softcascade/src/octave.cpp index 5c5aa2eec..96b8c6192 100644 --- a/modules/softcascade/src/octave.cpp +++ b/modules/softcascade/src/octave.cpp @@ -445,7 +445,7 @@ void BoostedSoftCascadeOctave::write( CvFileStorage* fs, cv::String _name) const } -CV_INIT_ALGORITHM(BoostedSoftCascadeOctave, "Octave.BoostedSoftCascadeOctave", ); +CV_INIT_ALGORITHM(BoostedSoftCascadeOctave, "Octave.BoostedSoftCascadeOctave", ) Octave::~Octave(){} diff --git a/modules/softcascade/src/softcascade_init.cpp b/modules/softcascade/src/softcascade_init.cpp index 6f3c8b6a5..59a33f8c0 100644 --- a/modules/softcascade/src/softcascade_init.cpp +++ b/modules/softcascade/src/softcascade_init.cpp @@ -49,12 +49,12 @@ CV_INIT_ALGORITHM(Detector, "SoftCascade.Detector", obj.info()->addParam(obj, "minScale", obj.minScale); obj.info()->addParam(obj, "maxScale", obj.maxScale); obj.info()->addParam(obj, "scales", obj.scales); - obj.info()->addParam(obj, "rejCriteria", obj.rejCriteria)); + obj.info()->addParam(obj, "rejCriteria", obj.rejCriteria)) CV_INIT_ALGORITHM(SCascade, "CascadeDetector.SCascade", obj.info()->addParam(obj, "minScale", obj.minScale); obj.info()->addParam(obj, "maxScale", obj.maxScale); - obj.info()->addParam(obj, "scales", obj.scales)); + obj.info()->addParam(obj, "scales", obj.scales)) bool initModule_softcascade(void) { diff --git a/modules/stitching/doc/exposure_compensation.rst b/modules/stitching/doc/exposure_compensation.rst index eff98c01c..ec0d5db32 100644 --- a/modules/stitching/doc/exposure_compensation.rst +++ b/modules/stitching/doc/exposure_compensation.rst @@ -62,8 +62,8 @@ Stub exposure compensator which does nothing. :: { public: void feed(const std::vector &/*corners*/, const std::vector &/*images*/, - const std::vector > &/*masks*/) {}; - void apply(int /*index*/, Point /*corner*/, Mat &/*image*/, const Mat &/*mask*/) {}; + const std::vector > &/*masks*/) { } + void apply(int /*index*/, Point /*corner*/, Mat &/*image*/, const Mat &/*mask*/) { } }; .. seealso:: :ocv:class:`detail::ExposureCompensator` diff --git a/modules/stitching/include/opencv2/stitching/detail/exposure_compensate.hpp b/modules/stitching/include/opencv2/stitching/detail/exposure_compensate.hpp index f39785f57..84a8ce4fe 100644 --- a/modules/stitching/include/opencv2/stitching/detail/exposure_compensate.hpp +++ b/modules/stitching/include/opencv2/stitching/detail/exposure_compensate.hpp @@ -68,8 +68,8 @@ class CV_EXPORTS NoExposureCompensator : public ExposureCompensator { public: void feed(const std::vector &/*corners*/, const std::vector &/*images*/, - const std::vector > &/*masks*/) {}; - void apply(int /*index*/, Point /*corner*/, Mat &/*image*/, const Mat &/*mask*/) {}; + const std::vector > &/*masks*/) { } + void apply(int /*index*/, Point /*corner*/, Mat &/*image*/, const Mat &/*mask*/) { } }; diff --git a/modules/video/test/test_accum.cpp b/modules/video/test/test_accum.cpp index ef6c05f98..6895bb4ea 100644 --- a/modules/video/test/test_accum.cpp +++ b/modules/video/test/test_accum.cpp @@ -100,7 +100,7 @@ double CV_AccumBaseTest::get_success_error_level( int /*test_case_idx*/, int /*i class CV_AccTest : public CV_AccumBaseTest { public: - CV_AccTest() {}; + CV_AccTest() { } protected: void run_func(); void prepare_to_validation( int ); diff --git a/modules/video/test/test_ecc.cpp b/modules/video/test/test_ecc.cpp index 4065e6182..6b60a181f 100644 --- a/modules/video/test/test_ecc.cpp +++ b/modules/video/test/test_ecc.cpp @@ -107,7 +107,7 @@ protected: bool testTranslation(int); }; -CV_ECC_Test_Translation::CV_ECC_Test_Translation(){}; +CV_ECC_Test_Translation::CV_ECC_Test_Translation(){} bool CV_ECC_Test_Translation::testTranslation(int from) { @@ -256,7 +256,7 @@ protected: bool testAffine(int); }; -CV_ECC_Test_Affine::CV_ECC_Test_Affine(){}; +CV_ECC_Test_Affine::CV_ECC_Test_Affine(){} bool CV_ECC_Test_Affine::testAffine(int from) @@ -332,7 +332,7 @@ protected: bool testHomography(int); }; -CV_ECC_Test_Homography::CV_ECC_Test_Homography(){}; +CV_ECC_Test_Homography::CV_ECC_Test_Homography(){} bool CV_ECC_Test_Homography::testHomography(int from) {