Commit 3ae595c1 authored by Alexandre Benoit's avatar Alexandre Benoit

updated code formating of reina samples

parent 154bc89d
......@@ -51,8 +51,8 @@ static void drawPlot(const cv::Mat curve, const std::string figureTitle, const i
/*
* objective : get the gray level map of the input image and rescale it to the range [0-255]
*/
static void rescaleGrayLevelMat(const cv::Mat &inputMat, cv::Mat &outputMat, const float histogramClippingLimit)
{
static void rescaleGrayLevelMat(const cv::Mat &inputMat, cv::Mat &outputMat, const float histogramClippingLimit)
{
// adjust output matrix wrt the input size but single channel
std::cout<<"Input image rescaling with histogram edges cutting (in order to eliminate bad pixels created during the HDR image creation) :"<<std::endl;
......@@ -116,33 +116,34 @@ static void drawPlot(const cv::Mat curve, const std::string figureTitle, const i
cv::threshold( outputMat, outputMat, 255.0, 255.0, 2 ); //THRESH_TRUNC, clips values above 255
cv::threshold( outputMat, outputMat, 0.0, 0.0, 3 ); //THRESH_TOZERO, clips values under 0
}
// basic callback method for interface management
cv::Mat inputImage;
cv::Mat imageInputRescaled;
int histogramClippingValue;
static void callBack_rescaleGrayLevelMat(int, void*)
{
}
// basic callback method for interface management
cv::Mat inputImage;
cv::Mat imageInputRescaled;
int histogramClippingValue;
static void callBack_rescaleGrayLevelMat(int, void*)
{
std::cout<<"Histogram clipping value changed, current value = "<<histogramClippingValue<<std::endl;
rescaleGrayLevelMat(inputImage, imageInputRescaled, (float)(histogramClippingValue/100.0));
normalize(imageInputRescaled, imageInputRescaled, 0.0, 255.0, cv::NORM_MINMAX);
}
}
cv::Ptr<cv::bioinspired::Retina> retina;
int retinaHcellsGain;
int localAdaptation_photoreceptors, localAdaptation_Gcells;
static void callBack_updateRetinaParams(int, void*)
{
cv::Ptr<cv::bioinspired::Retina> retina;
int retinaHcellsGain;
int localAdaptation_photoreceptors, localAdaptation_Gcells;
static void callBack_updateRetinaParams(int, void*)
{
retina->setupOPLandIPLParvoChannel(true, true, (float)(localAdaptation_photoreceptors/200.0), 0.5f, 0.43f, (float)retinaHcellsGain, 1.f, 7.f, (float)(localAdaptation_Gcells/200.0));
}
}
int colorSaturationFactor;
static void callback_saturateColors(int, void*)
{
int colorSaturationFactor;
static void callback_saturateColors(int, void*)
{
retina->setColorSaturation(true, (float)colorSaturationFactor);
}
}
int main(int argc, char* argv[]) {
int main(int argc, char* argv[])
{
// welcome message
std::cout<<"*********************************************************************************"<<std::endl;
std::cout<<"* Retina demonstration for High Dynamic Range compression (tone-mapping) : demonstrates the use of a wrapper class of the Gipsa/Listic Labs retina model."<<std::endl;
......@@ -289,7 +290,7 @@ static void drawPlot(const cv::Mat curve, const std::string figureTitle, const i
fastToneMapper->setup(3.f, 1.5f, 1.f);
fastToneMapper->applyFastToneMapping(imageInputRescaled, fastToneMappingOutput_specificObject);
cv::imshow("### Retina fast tone mapping output : 16bit=>8bit image retina tonemapping", fastToneMappingOutput_specificObject);
*/
*/
cv::waitKey(10);
}
}catch(cv::Exception e)
......@@ -301,4 +302,4 @@ static void drawPlot(const cv::Mat curve, const std::string figureTitle, const i
std::cout<<"Retina demo end"<<std::endl;
return 0;
}
}
......@@ -32,7 +32,8 @@ static void help(std::string errorMessage)
std::cout<<"\nPlease start again with new parameters"<<std::endl;
}
int main(int argc, char* argv[]) {
int main(int argc, char* argv[])
{
// welcome message
std::cout<<"****************************************************"<<std::endl;
std::cout<<"* Retina demonstration : demonstrates the use of is a wrapper class of the Gipsa/Listic Labs retina model."<<std::endl;
......
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