Commit 2c1fb5fd authored by alexandre benoit's avatar alexandre benoit

minor correction after buildbot warnings

parent 7bff79bb
******************************************************************* ********************************************************************
bioinspired. Biologically inspired vision models and derivated tools bioinspired. Biologically inspired vision models and derivated tools
******************************************************************* ********************************************************************
The module provides biological visual systems models (human visual system and others). It also provides derivated objects that take advantage of those bio-inspired models. The module provides biological visual systems models (human visual system and others). It also provides derivated objects that take advantage of those bio-inspired models.
......
...@@ -181,7 +181,7 @@ Take a look at the provided C++ examples provided with OpenCV : ...@@ -181,7 +181,7 @@ Take a look at the provided C++ examples provided with OpenCV :
**OpenCVReleaseFolder/bin/OpenEXRimages_HighDynamicRange_Retina_toneMapping memorial.exr [optionnal: 'fast']** **OpenCVReleaseFolder/bin/OpenEXRimages_HighDynamicRange_Retina_toneMapping memorial.exr [optionnal: 'fast']**
Note that some sliders are made available to allow you to play with luminance compression. Note that some sliders are made available to allow you to play with luminance compression.
If not using the 'fast' option, then, tone mapping is performed using the full retina model [Benoit2010]_. It includes spectral whitening that allows luminance energy to be reduced. When using the 'fast' option, then, a simpler method is used, it is an adaptation of the algorithm presented in [Meylan2007]_. This method gives also good results and is faster to process but it sometimes requires some more parameters adjustement. If not using the 'fast' option, then, tone mapping is performed using the full retina model [Benoit2010]_. It includes spectral whitening that allows luminance energy to be reduced. When using the 'fast' option, then, a simpler method is used, it is an adaptation of the algorithm presented in [Meylan2007]_. This method gives also good results and is faster to process but it sometimes requires some more parameters adjustement.
......
...@@ -327,4 +327,3 @@ CV_EXPORTS Ptr<Retina> createRetina(Size inputSize, const bool colorMode, RETINA ...@@ -327,4 +327,3 @@ CV_EXPORTS Ptr<Retina> createRetina(Size inputSize, const bool colorMode, RETINA
} }
} }
#endif /* __OPENCV_BIOINSPIRED_RETINA_HPP__ */ #endif /* __OPENCV_BIOINSPIRED_RETINA_HPP__ */
...@@ -64,8 +64,8 @@ ...@@ -64,8 +64,8 @@
** the use of this software, even if advised of the possibility of such damage. ** the use of this software, even if advised of the possibility of such damage.
*******************************************************************************/ *******************************************************************************/
#ifndef __OPENCV_CONTRIB_RETINAFASTTONEMAPPING_HPP__ #ifndef __OPENCV_BIOINSPIRED_RETINAFASTTONEMAPPING_HPP__
#define __OPENCV_CONTRIB_RETINAFASTTONEMAPPING_HPP__ #define __OPENCV_BIOINSPIRED_RETINAFASTTONEMAPPING_HPP__
/* /*
* retinafasttonemapping.hpp * retinafasttonemapping.hpp
...@@ -108,7 +108,7 @@ public: ...@@ -108,7 +108,7 @@ public:
/** /**
* setup method that updates tone mapping behaviors by adjusing the local luminance computation area * setup method that updates tone mapping behaviors by adjusing the local luminance computation area
* @param photoreceptorsNeighborhoodRadius the first stage local adaptation area * @param photoreceptorsNeighborhoodRadius the first stage local adaptation area
* @param ganglioncellsNeighborhoodRadius the second stage local adaptation area * @param ganglioncellsNeighborhoodRadius the second stage local adaptation area
* @param meanLuminanceModulatorK the factor applied to modulate the meanLuminance information (default is 1, see reference paper) * @param meanLuminanceModulatorK the factor applied to modulate the meanLuminance information (default is 1, see reference paper)
*/ */
...@@ -119,5 +119,4 @@ CV_EXPORTS Ptr<RetinaFastToneMapping> createRetinaFastToneMapping(Size inputSize ...@@ -119,5 +119,4 @@ CV_EXPORTS Ptr<RetinaFastToneMapping> createRetinaFastToneMapping(Size inputSize
} }
} }
#endif /* __OPENCV_CONTRIB_RETINAFASTTONEMAPPING_HPP__ */ #endif /* __OPENCV_BIOINSPIRED_RETINAFASTTONEMAPPING_HPP__ */
...@@ -655,5 +655,3 @@ namespace hvstools ...@@ -655,5 +655,3 @@ namespace hvstools
}// end of namespace hvstools }// end of namespace hvstools
}// end of namespace cv }// end of namespace cv
#endif #endif
...@@ -210,5 +210,3 @@ const std::valarray<float> &MagnoRetinaFilter::runFilter(const std::valarray<flo ...@@ -210,5 +210,3 @@ const std::valarray<float> &MagnoRetinaFilter::runFilter(const std::valarray<flo
} }
}// end of namespace hvstools }// end of namespace hvstools
}// end of namespace cv }// end of namespace cv
...@@ -243,5 +243,3 @@ namespace hvstools ...@@ -243,5 +243,3 @@ namespace hvstools
}// end of namespace cv }// end of namespace cv
#endif /*MagnoRetinaFilter_H_*/ #endif /*MagnoRetinaFilter_H_*/
...@@ -231,4 +231,3 @@ void ParvoRetinaFilter::_OPL_OnOffWaysComputing() // WARNING : this method requi ...@@ -231,4 +231,3 @@ void ParvoRetinaFilter::_OPL_OnOffWaysComputing() // WARNING : this method requi
} }
}// end of namespace hvstools }// end of namespace hvstools
}// end of namespace cv }// end of namespace cv
...@@ -261,4 +261,3 @@ private: ...@@ -261,4 +261,3 @@ private:
}// end of namespace hvstools }// end of namespace hvstools
}// end of namespace cv }// end of namespace cv
#endif #endif
...@@ -528,13 +528,13 @@ void RetinaImpl::applyFastToneMapping(InputArray inputImage, OutputArray outputT ...@@ -528,13 +528,13 @@ void RetinaImpl::applyFastToneMapping(InputArray inputImage, OutputArray outputT
// process tone mapping // process tone mapping
if (colorMode) if (colorMode)
{ {
std::valarray<float> imageOutput(nbPixels*3); std::valarray<float> imageOutput(nbPixels*3);
_retinaFilter->runRGBToneMapping(_inputBuffer, imageOutput, true, _retinaParameters.OPLandIplParvo.photoreceptorsLocalAdaptationSensitivity, _retinaParameters.OPLandIplParvo.ganglionCellsSensitivity); _retinaFilter->runRGBToneMapping(_inputBuffer, imageOutput, true, _retinaParameters.OPLandIplParvo.photoreceptorsLocalAdaptationSensitivity, _retinaParameters.OPLandIplParvo.ganglionCellsSensitivity);
_convertValarrayBuffer2cvMat(imageOutput, _retinaFilter->getOutputNBrows(), _retinaFilter->getOutputNBcolumns(), true, outputToneMappedImage); _convertValarrayBuffer2cvMat(imageOutput, _retinaFilter->getOutputNBrows(), _retinaFilter->getOutputNBcolumns(), true, outputToneMappedImage);
}else }else
{ {
std::valarray<float> imageOutput(nbPixels); std::valarray<float> imageOutput(nbPixels);
_retinaFilter->runGrayToneMapping(_inputBuffer, imageOutput, _retinaParameters.OPLandIplParvo.photoreceptorsLocalAdaptationSensitivity, _retinaParameters.OPLandIplParvo.ganglionCellsSensitivity); _retinaFilter->runGrayToneMapping(_inputBuffer, imageOutput, _retinaParameters.OPLandIplParvo.photoreceptorsLocalAdaptationSensitivity, _retinaParameters.OPLandIplParvo.ganglionCellsSensitivity);
_convertValarrayBuffer2cvMat(imageOutput, _retinaFilter->getOutputNBrows(), _retinaFilter->getOutputNBcolumns(), false, outputToneMappedImage); _convertValarrayBuffer2cvMat(imageOutput, _retinaFilter->getOutputNBrows(), _retinaFilter->getOutputNBcolumns(), false, outputToneMappedImage);
} }
...@@ -671,7 +671,6 @@ bool _convertCvMat2ValarrayBuffer(InputArray inputMat, std::valarray<float> &out ...@@ -671,7 +671,6 @@ bool _convertCvMat2ValarrayBuffer(InputArray inputMat, std::valarray<float> &out
typedef float T; // define here the target pixel format, here, float typedef float T; // define here the target pixel format, here, float
const int dsttype = DataType<T>::depth; // output buffer is float format const int dsttype = DataType<T>::depth; // output buffer is float format
const unsigned int nbPixels=inputMat.getMat().rows*inputMat.getMat().cols; const unsigned int nbPixels=inputMat.getMat().rows*inputMat.getMat().cols;
const unsigned int doubleNBpixels=inputMat.getMat().rows*inputMat.getMat().cols*2; const unsigned int doubleNBpixels=inputMat.getMat().rows*inputMat.getMat().cols*2;
...@@ -720,4 +719,3 @@ void RetinaImpl::activateContoursProcessing(const bool activate){_retinaFilter-> ...@@ -720,4 +719,3 @@ void RetinaImpl::activateContoursProcessing(const bool activate){_retinaFilter->
}// end of namespace hvstools }// end of namespace hvstools
}// end of namespace cv }// end of namespace cv
...@@ -387,5 +387,3 @@ namespace hvstools ...@@ -387,5 +387,3 @@ namespace hvstools
}// end of namespace cv }// end of namespace cv
#endif /*RETINACOLOR_HPP_*/ #endif /*RETINACOLOR_HPP_*/
...@@ -111,7 +111,7 @@ public: ...@@ -111,7 +111,7 @@ public:
// resize buffers // resize buffers
_inputBuffer.resize(nbPixels*3); // buffer supports gray images but also 3 channels color buffers... (larger is better...) _inputBuffer.resize(nbPixels*3); // buffer supports gray images but also 3 channels color buffers... (larger is better...)
_imageOutput.resize(nbPixels*3); _imageOutput.resize(nbPixels*3);
_temp2.resize(nbPixels); _temp2.resize(nbPixels);
// allocate the main filter with 2 setup sets properties (one for each low pass filter // allocate the main filter with 2 setup sets properties (one for each low pass filter
_multiuseFilter = new BasicRetinaFilter(imageInput.height, imageInput.width, 2); _multiuseFilter = new BasicRetinaFilter(imageInput.height, imageInput.width, 2);
...@@ -144,7 +144,7 @@ public: ...@@ -144,7 +144,7 @@ public:
_convertValarrayBuffer2cvMat(_imageOutput, _multiuseFilter->getNBrows(), _multiuseFilter->getNBcolumns(), true, outputToneMappedImage); _convertValarrayBuffer2cvMat(_imageOutput, _multiuseFilter->getNBrows(), _multiuseFilter->getNBcolumns(), true, outputToneMappedImage);
}else }else
{ {
_runGrayToneMapping(_inputBuffer, _imageOutput); _runGrayToneMapping(_inputBuffer, _imageOutput);
_convertValarrayBuffer2cvMat(_imageOutput, _multiuseFilter->getNBrows(), _multiuseFilter->getNBcolumns(), false, outputToneMappedImage); _convertValarrayBuffer2cvMat(_imageOutput, _multiuseFilter->getNBrows(), _multiuseFilter->getNBcolumns(), false, outputToneMappedImage);
} }
...@@ -152,17 +152,17 @@ public: ...@@ -152,17 +152,17 @@ public:
/** /**
* setup method that updates tone mapping behaviors by adjusing the local luminance computation area * setup method that updates tone mapping behaviors by adjusing the local luminance computation area
* @param photoreceptorsNeighborhoodRadius the first stage local adaptation area * @param photoreceptorsNeighborhoodRadius the first stage local adaptation area
* @param ganglioncellsNeighborhoodRadius the second stage local adaptation area * @param ganglioncellsNeighborhoodRadius the second stage local adaptation area
* @param meanLuminanceModulatorK the factor applied to modulate the meanLuminance information (default is 1, see reference paper) * @param meanLuminanceModulatorK the factor applied to modulate the meanLuminance information (default is 1, see reference paper)
*/ */
virtual void setup(const float photoreceptorsNeighborhoodRadius=3.f, const float ganglioncellsNeighborhoodRadius=1.f, const float meanLuminanceModulatorK=1.f) virtual void setup(const float photoreceptorsNeighborhoodRadius=3.f, const float ganglioncellsNeighborhoodRadius=1.f, const float meanLuminanceModulatorK=1.f)
{ {
// setup the spatio-temporal properties of each filter // setup the spatio-temporal properties of each filter
_meanLuminanceModulatorK = meanLuminanceModulatorK; _meanLuminanceModulatorK = meanLuminanceModulatorK;
_multiuseFilter->setV0CompressionParameter(1.f, 255.f, 128.f); _multiuseFilter->setV0CompressionParameter(1.f, 255.f, 128.f);
_multiuseFilter->setLPfilterParameters(0.f, 0.f, photoreceptorsNeighborhoodRadius, 1); _multiuseFilter->setLPfilterParameters(0.f, 0.f, photoreceptorsNeighborhoodRadius, 1);
_multiuseFilter->setLPfilterParameters(0.f, 0.f, ganglioncellsNeighborhoodRadius, 2); _multiuseFilter->setLPfilterParameters(0.f, 0.f, ganglioncellsNeighborhoodRadius, 2);
} }
private: private:
...@@ -171,7 +171,7 @@ private: ...@@ -171,7 +171,7 @@ private:
cv::Ptr <RetinaColor> _colorEngine; cv::Ptr <RetinaColor> _colorEngine;
//!< buffer used to convert input cv::Mat to internal retina buffers format (valarrays) //!< buffer used to convert input cv::Mat to internal retina buffers format (valarrays)
std::valarray<float> _inputBuffer; std::valarray<float> _inputBuffer;
std::valarray<float> _imageOutput; std::valarray<float> _imageOutput;
std::valarray<float> _temp2; std::valarray<float> _temp2;
float _meanLuminanceModulatorK; float _meanLuminanceModulatorK;
......
...@@ -553,6 +553,3 @@ public: ...@@ -553,6 +553,3 @@ public:
}// end of namespace hvstools }// end of namespace hvstools
}// end of namespace cv }// end of namespace cv
#endif #endif
...@@ -14,4 +14,3 @@ ...@@ -14,4 +14,3 @@
#include <iostream> #include <iostream>
#endif #endif
This diff is collapsed.
...@@ -227,7 +227,7 @@ static void drawPlot(const cv::Mat curve, const std::string figureTitle, const i ...@@ -227,7 +227,7 @@ static void drawPlot(const cv::Mat curve, const std::string figureTitle, const i
std::cout<<"Allocating fast tone mapper..."<<std::endl; std::cout<<"Allocating fast tone mapper..."<<std::endl;
//cv::Ptr<cv::RetinaFastToneMapping> fastToneMapper=createRetinaFastToneMapping(inputImage.size()); //cv::Ptr<cv::RetinaFastToneMapping> fastToneMapper=createRetinaFastToneMapping(inputImage.size());
std::cout<<"Fast tone mapper allocated"<<std::endl; std::cout<<"Fast tone mapper allocated"<<std::endl;
// save default retina parameters file in order to let you see this and maybe modify it and reload using method "setup" // save default retina parameters file in order to let you see this and maybe modify it and reload using method "setup"
retina->write("RetinaDefaultParameters.xml"); retina->write("RetinaDefaultParameters.xml");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment