Commit 0a8d841b authored by atinfinity's avatar atinfinity Committed by Alexander Alekhin

Merge pull request #2412 from atinfinity:fixed-typo

* fixed typo

* fixed document
parent 5834bea0
...@@ -124,7 +124,7 @@ class CV_EXPORTS_W CharucoBoard : public Board { ...@@ -124,7 +124,7 @@ class CV_EXPORTS_W CharucoBoard : public Board {
// size of chessboard squares side (normally in meters) // size of chessboard squares side (normally in meters)
float _squareLength; float _squareLength;
// marker side lenght (normally in meters) // marker side length (normally in meters)
float _markerLength; float _markerLength;
}; };
......
...@@ -50,7 +50,7 @@ const char* about = "Pose estimation using a ArUco Planar Grid board"; ...@@ -50,7 +50,7 @@ const char* about = "Pose estimation using a ArUco Planar Grid board";
const char* keys = const char* keys =
"{w | | Number of squares in X direction }" "{w | | Number of squares in X direction }"
"{h | | Number of squares in Y direction }" "{h | | Number of squares in Y direction }"
"{l | | Marker side lenght (in pixels) }" "{l | | Marker side length (in pixels) }"
"{s | | Separation between two consecutive markers in the grid (in pixels)}" "{s | | Separation between two consecutive markers in the grid (in pixels)}"
"{d | | dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2," "{d | | dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2,"
"DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, " "DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, "
......
...@@ -55,7 +55,7 @@ const char* keys = ...@@ -55,7 +55,7 @@ const char* keys =
"{v | | Input from video file, if ommited, input comes from camera }" "{v | | Input from video file, if ommited, input comes from camera }"
"{ci | 0 | Camera id if input doesnt come from video (-v) }" "{ci | 0 | Camera id if input doesnt come from video (-v) }"
"{c | | Camera intrinsic parameters. Needed for camera pose }" "{c | | Camera intrinsic parameters. Needed for camera pose }"
"{l | 0.1 | Marker side lenght (in meters). Needed for correct scale in camera pose }" "{l | 0.1 | Marker side length (in meters). Needed for correct scale in camera pose }"
"{dp | | File of marker detector parameters }" "{dp | | File of marker detector parameters }"
"{r | | show rejected candidates too }" "{r | | show rejected candidates too }"
"{refine | | Corner refinement: CORNER_REFINE_NONE=0, CORNER_REFINE_SUBPIX=1," "{refine | | Corner refinement: CORNER_REFINE_NONE=0, CORNER_REFINE_SUBPIX=1,"
......
...@@ -113,7 +113,7 @@ A ```GridBoard``` object can be defined using the following parameters: ...@@ -113,7 +113,7 @@ A ```GridBoard``` object can be defined using the following parameters:
- Number of markers in the X direction. - Number of markers in the X direction.
- Number of markers in the Y direction. - Number of markers in the Y direction.
- Lenght of the marker side. - Length of the marker side.
- Length of the marker separation. - Length of the marker separation.
- The dictionary of the markers. - The dictionary of the markers.
- Ids of all the markers (X*Y markers). - Ids of all the markers (X*Y markers).
......
...@@ -207,7 +207,7 @@ functions (C++, Java, Python) : ...@@ -207,7 +207,7 @@ functions (C++, Java, Python) :
// Allocators // Allocators
cv::Ptr<Retina> Retina::create (Size inputSize); cv::Ptr<Retina> Retina::create (Size inputSize);
cv::Ptr<Retina> Retina::create (Size inputSize, const bool colorMode, RETINA_COLORSAMPLINGMETHOD colorSamplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const double reductionFactor=1.0, const double samplingStrenght=10.0); cv::Ptr<Retina> Retina::create (Size inputSize, const bool colorMode, RETINA_COLORSAMPLINGMETHOD colorSamplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const double reductionFactor=1.0, const double samplingStrength=10.0);
}} // cv and bioinspired namespaces end }} // cv and bioinspired namespaces end
@endcode @endcode
......
...@@ -438,13 +438,13 @@ public: ...@@ -438,13 +438,13 @@ public:
@param reductionFactor only usefull if param useRetinaLogSampling=true, specifies the reduction @param reductionFactor only usefull if param useRetinaLogSampling=true, specifies the reduction
factor of the output frame (as the center (fovea) is high resolution and corners can be factor of the output frame (as the center (fovea) is high resolution and corners can be
underscaled, then a reduction of the output is allowed without precision leak underscaled, then a reduction of the output is allowed without precision leak
@param samplingStrenght only usefull if param useRetinaLogSampling=true, specifies the strenght of @param samplingStrength only usefull if param useRetinaLogSampling=true, specifies the strength of
the log scale that is applied the log scale that is applied
*/ */
CV_WRAP static Ptr<Retina> create(Size inputSize, const bool colorMode, CV_WRAP static Ptr<Retina> create(Size inputSize, const bool colorMode,
int colorSamplingMethod=RETINA_COLOR_BAYER, int colorSamplingMethod=RETINA_COLOR_BAYER,
const bool useRetinaLogSampling=false, const bool useRetinaLogSampling=false,
const float reductionFactor=1.0f, const float samplingStrenght=10.0f); const float reductionFactor=1.0f, const float samplingStrength=10.0f);
}; };
//! @} //! @}
......
...@@ -257,7 +257,7 @@ namespace bioinspired ...@@ -257,7 +257,7 @@ namespace bioinspired
* @param beta: gain of the filter (generally set to zero) * @param beta: gain of the filter (generally set to zero)
* @param tau: time constant of the filter (unit is frame for video processing) * @param tau: time constant of the filter (unit is frame for video processing)
* @param alpha0: spatial constant of the filter (unit is pixels) on the border of the image * @param alpha0: spatial constant of the filter (unit is pixels) on the border of the image
* @param accuracyMap an image (float format) which values range is between 0 and 1, where 0 means, apply no filtering and 1 means apply the filtering as specified in the parameters set, intermediate values allow to smooth variations of the filtering strenght * @param accuracyMap an image (float format) which values range is between 0 and 1, where 0 means, apply no filtering and 1 means apply the filtering as specified in the parameters set, intermediate values allow to smooth variations of the filtering strength
* @param filterIndex: the index which specifies the parameter set that should be used for the filtering * @param filterIndex: the index which specifies the parameter set that should be used for the filtering
*/ */
void setProgressiveFilterConstants_CustomAccuracy(const float beta, const float tau, const float alpha0, const std::valarray<float> &accuracyMap, const unsigned int filterIndex=0); void setProgressiveFilterConstants_CustomAccuracy(const float beta, const float tau, const float alpha0, const std::valarray<float> &accuracyMap, const unsigned int filterIndex=0);
......
...@@ -125,7 +125,7 @@ void ImageLogPolProjection::clearAllBuffers() ...@@ -125,7 +125,7 @@ void ImageLogPolProjection::clearAllBuffers()
void ImageLogPolProjection::resize(const unsigned int NBrows, const unsigned int NBcolumns) void ImageLogPolProjection::resize(const unsigned int NBrows, const unsigned int NBcolumns)
{ {
BasicRetinaFilter::resize(NBrows, NBcolumns); BasicRetinaFilter::resize(NBrows, NBcolumns);
initProjection(_reductionFactor, _samplingStrenght); initProjection(_reductionFactor, _samplingStrength);
// reset buffers method // reset buffers method
clearAllBuffers(); clearAllBuffers();
...@@ -133,25 +133,25 @@ void ImageLogPolProjection::resize(const unsigned int NBrows, const unsigned int ...@@ -133,25 +133,25 @@ void ImageLogPolProjection::resize(const unsigned int NBrows, const unsigned int
} }
// init functions depending on the projection type // init functions depending on the projection type
bool ImageLogPolProjection::initProjection(const double reductionFactor, const double samplingStrenght) bool ImageLogPolProjection::initProjection(const double reductionFactor, const double samplingStrength)
{ {
switch(_selectedProjection) switch(_selectedProjection)
{ {
case RETINALOGPROJECTION: case RETINALOGPROJECTION:
return _initLogRetinaSampling(reductionFactor, samplingStrenght); return _initLogRetinaSampling(reductionFactor, samplingStrength);
break; break;
case CORTEXLOGPOLARPROJECTION: case CORTEXLOGPOLARPROJECTION:
return _initLogPolarCortexSampling(reductionFactor, samplingStrenght); return _initLogPolarCortexSampling(reductionFactor, samplingStrength);
break; break;
default: default:
std::cout<<"ImageLogPolProjection::no projection setted up... performing default retina projection... take care"<<std::endl; std::cout<<"ImageLogPolProjection::no projection setted up... performing default retina projection... take care"<<std::endl;
return _initLogRetinaSampling(reductionFactor, samplingStrenght); return _initLogRetinaSampling(reductionFactor, samplingStrength);
break; break;
} }
} }
// -> private init functions dedicated to each projection // -> private init functions dedicated to each projection
bool ImageLogPolProjection::_initLogRetinaSampling(const double reductionFactor, const double samplingStrenght) bool ImageLogPolProjection::_initLogRetinaSampling(const double reductionFactor, const double samplingStrength)
{ {
_initOK=false; _initOK=false;
...@@ -173,7 +173,7 @@ bool ImageLogPolProjection::_initLogRetinaSampling(const double reductionFactor, ...@@ -173,7 +173,7 @@ bool ImageLogPolProjection::_initLogRetinaSampling(const double reductionFactor,
_outputDoubleNBpixels=_outputNBrows*_outputNBcolumns*2; _outputDoubleNBpixels=_outputNBrows*_outputNBcolumns*2;
#ifdef IMAGELOGPOLPROJECTION_DEBUG #ifdef IMAGELOGPOLPROJECTION_DEBUG
std::cout<<"ImageLogPolProjection::initLogRetinaSampling: Log resampled image resampling factor: "<<reductionFactor<<", strenght:"<<samplingStrenght<<std::endl; std::cout<<"ImageLogPolProjection::initLogRetinaSampling: Log resampled image resampling factor: "<<reductionFactor<<", strength:"<<samplingStrength<<std::endl;
std::cout<<"ImageLogPolProjection::initLogRetinaSampling: Log resampled image size: "<<_outputNBrows<<"*"<<_outputNBcolumns<<std::endl; std::cout<<"ImageLogPolProjection::initLogRetinaSampling: Log resampled image size: "<<_outputNBrows<<"*"<<_outputNBcolumns<<std::endl;
#endif #endif
...@@ -185,16 +185,16 @@ bool ImageLogPolProjection::_initLogRetinaSampling(const double reductionFactor, ...@@ -185,16 +185,16 @@ bool ImageLogPolProjection::_initLogRetinaSampling(const double reductionFactor,
// specifiying new reduction factor after preliminar checks // specifiying new reduction factor after preliminar checks
_reductionFactor=reductionFactor; _reductionFactor=reductionFactor;
_samplingStrenght=samplingStrenght; _samplingStrength=samplingStrength;
// compute the rlim for symetric rows/columns sampling, then, the rlim is based on the smallest dimension // compute the rlim for symetric rows/columns sampling, then, the rlim is based on the smallest dimension
_minDimension=(double)(_filterOutput.getNBrows() < _filterOutput.getNBcolumns() ? _filterOutput.getNBrows() : _filterOutput.getNBcolumns()); _minDimension=(double)(_filterOutput.getNBrows() < _filterOutput.getNBcolumns() ? _filterOutput.getNBrows() : _filterOutput.getNBcolumns());
// input frame dimensions dependent log sampling: // input frame dimensions dependent log sampling:
//double rlim=1.0/reductionFactor*(minDimension/2.0+samplingStrenght); //double rlim=1.0/reductionFactor*(minDimension/2.0+samplingStrength);
// input frame dimensions INdependent log sampling: // input frame dimensions INdependent log sampling:
_azero=(1.0+reductionFactor*std::sqrt(samplingStrenght))/(reductionFactor*reductionFactor*samplingStrenght-1.0); _azero=(1.0+reductionFactor*std::sqrt(samplingStrength))/(reductionFactor*reductionFactor*samplingStrength-1.0);
_alim=(1.0+_azero)/reductionFactor; _alim=(1.0+_azero)/reductionFactor;
#ifdef IMAGELOGPOLPROJECTION_DEBUG #ifdef IMAGELOGPOLPROJECTION_DEBUG
std::cout<<"ImageLogPolProjection::initLogRetinaSampling: rlim= "<<rlim<<std::endl; std::cout<<"ImageLogPolProjection::initLogRetinaSampling: rlim= "<<rlim<<std::endl;
...@@ -224,7 +224,7 @@ bool ImageLogPolProjection::_initLogRetinaSampling(const double reductionFactor, ...@@ -224,7 +224,7 @@ bool ImageLogPolProjection::_initLogRetinaSampling(const double reductionFactor,
// get the pixel position in the original picture // get the pixel position in the original picture
// -> input frame dimensions dependent log sampling: // -> input frame dimensions dependent log sampling:
//double scale = samplingStrenght/(rlim-(double)std::sqrt(idRow*idRow+idColumn*idColumn)); //double scale = samplingStrength/(rlim-(double)std::sqrt(idRow*idRow+idColumn*idColumn));
// -> input frame dimensions INdependent log sampling: // -> input frame dimensions INdependent log sampling:
double scale=getOriginalRadiusLength((double)std::sqrt((double)(idRow*idRow+idColumn*idColumn))); double scale=getOriginalRadiusLength((double)std::sqrt((double)(idRow*idRow+idColumn*idColumn)));
...@@ -363,14 +363,14 @@ bool ImageLogPolProjection::_initLogPolarCortexSampling(const double reductionFa ...@@ -363,14 +363,14 @@ bool ImageLogPolProjection::_initLogPolarCortexSampling(const double reductionFa
//std::cout<<"ImageLogPolProjection::Starting cortex projection"<<std::endl; //std::cout<<"ImageLogPolProjection::Starting cortex projection"<<std::endl;
// compute transformation, get theta and Radius in reagrd of the output sampled pixel // compute transformation, get theta and Radius in reagrd of the output sampled pixel
double diagonalLenght=std::sqrt((double)(_outputNBcolumns*_outputNBcolumns+_outputNBrows*_outputNBrows)); double diagonalLength=std::sqrt((double)(_outputNBcolumns*_outputNBcolumns+_outputNBrows*_outputNBrows));
for (unsigned int radiusIndex=0;radiusIndex<_outputNBcolumns;++radiusIndex) for (unsigned int radiusIndex=0;radiusIndex<_outputNBcolumns;++radiusIndex)
for(unsigned int orientationIndex=0;orientationIndex<_outputNBrows;++orientationIndex) for(unsigned int orientationIndex=0;orientationIndex<_outputNBrows;++orientationIndex)
{ {
double x=1.0+sinh(radiusAxis[radiusIndex])*cos(orientationAxis[orientationIndex]); double x=1.0+sinh(radiusAxis[radiusIndex])*cos(orientationAxis[orientationIndex]);
double y=sinh(radiusAxis[radiusIndex])*sin(orientationAxis[orientationIndex]); double y=sinh(radiusAxis[radiusIndex])*sin(orientationAxis[orientationIndex]);
// get the input picture coordinate // get the input picture coordinate
double R=diagonalLenght*std::sqrt(x*x+y*y)/(5.0+std::sqrt(x*x+y*y)); double R=diagonalLength*std::sqrt(x*x+y*y)/(5.0+std::sqrt(x*x+y*y));
double theta=atan2(y,x); double theta=atan2(y,x);
// convert input polar coord into cartesian/C compatble coordinate // convert input polar coord into cartesian/C compatble coordinate
unsigned int columnIndex=(unsigned int)(cos(theta)*R)+halfInputColumns; unsigned int columnIndex=(unsigned int)(cos(theta)*R)+halfInputColumns;
......
...@@ -142,10 +142,10 @@ public: ...@@ -142,10 +142,10 @@ public:
/** /**
* init function depending on the projection type * init function depending on the projection type
* @param reductionFactor: the size reduction factor of the ouptup image in regard of the size of the input image, must be superior to 1 * @param reductionFactor: the size reduction factor of the ouptup image in regard of the size of the input image, must be superior to 1
* @param samplingStrenght: specifies the strenght of the log compression effect (magnifying coefficient) * @param samplingStrength: specifies the strength of the log compression effect (magnifying coefficient)
* @return true if the init was performed without any errors * @return true if the init was performed without any errors
*/ */
bool initProjection(const double reductionFactor, const double samplingStrenght); bool initProjection(const double reductionFactor, const double samplingStrength);
/** /**
* main funtion of the class: run projection function * main funtion of the class: run projection function
...@@ -206,8 +206,8 @@ private: ...@@ -206,8 +206,8 @@ private:
// is the object able to manage color flag // is the object able to manage color flag
bool _colorModeCapable; bool _colorModeCapable;
// sampling strenght factor // sampling strength factor
double _samplingStrenght; double _samplingStrength;
// sampling reduction factor // sampling reduction factor
double _reductionFactor; double _reductionFactor;
...@@ -231,8 +231,8 @@ private: ...@@ -231,8 +231,8 @@ private:
// specifies if init was done correctly // specifies if init was done correctly
bool _initOK; bool _initOK;
// private init projections functions called by "initProjection(...)" function // private init projections functions called by "initProjection(...)" function
bool _initLogRetinaSampling(const double reductionFactor, const double samplingStrenght); bool _initLogRetinaSampling(const double reductionFactor, const double samplingStrength);
bool _initLogPolarCortexSampling(const double reductionFactor, const double samplingStrenght); bool _initLogPolarCortexSampling(const double reductionFactor, const double samplingStrength);
ImageLogPolProjection(const ImageLogPolProjection&); ImageLogPolProjection(const ImageLogPolProjection&);
ImageLogPolProjection& operator=(const ImageLogPolProjection&); ImageLogPolProjection& operator=(const ImageLogPolProjection&);
......
...@@ -96,9 +96,9 @@ public: ...@@ -96,9 +96,9 @@ public:
* @param colorSamplingMethod: specifies which kind of color sampling will be used * @param colorSamplingMethod: specifies which kind of color sampling will be used
* @param useRetinaLogSampling: activate retina log sampling, if true, the 2 following parameters can be used * @param useRetinaLogSampling: activate retina log sampling, if true, the 2 following parameters can be used
* @param reductionFactor: only usefull if param useRetinaLogSampling=true, specifies the reduction factor of the output frame (as the center (fovea) is high resolution and corners can be underscaled, then a reduction of the output is allowed without precision leak * @param reductionFactor: only usefull if param useRetinaLogSampling=true, specifies the reduction factor of the output frame (as the center (fovea) is high resolution and corners can be underscaled, then a reduction of the output is allowed without precision leak
* @param samplingStrenght: only usefull if param useRetinaLogSampling=true, specifies the strenght of the log scale that is applied * @param samplingStrength: only usefull if param useRetinaLogSampling=true, specifies the strength of the log scale that is applied
*/ */
RetinaImpl(const Size inputSize, const bool colorMode, int colorSamplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const float reductionFactor=1.0f, const float samplingStrenght=10.0f); RetinaImpl(const Size inputSize, const bool colorMode, int colorSamplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const float reductionFactor=1.0f, const float samplingStrength=10.0f);
virtual ~RetinaImpl() CV_OVERRIDE; virtual ~RetinaImpl() CV_OVERRIDE;
/** /**
...@@ -272,7 +272,7 @@ private: ...@@ -272,7 +272,7 @@ private:
cv::Ptr<RetinaFilter> _retinaFilter; //!< the pointer to the retina module, allocated with instance construction cv::Ptr<RetinaFilter> _retinaFilter; //!< the pointer to the retina module, allocated with instance construction
//! private method called by constructors, gathers their parameters and use them in a unified way //! private method called by constructors, gathers their parameters and use them in a unified way
void _init(const Size inputSize, const bool colorMode, int colorSamplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const float reductionFactor=1.0f, const float samplingStrenght=10.0f); void _init(const Size inputSize, const bool colorMode, int colorSamplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const float reductionFactor=1.0f, const float samplingStrength=10.0f);
/** /**
* exports a valarray buffer outing from bioinspired objects to a cv::Mat in CV_8UC1 (gray level picture) or CV_8UC3 (color) format * exports a valarray buffer outing from bioinspired objects to a cv::Mat in CV_8UC1 (gray level picture) or CV_8UC3 (color) format
...@@ -311,9 +311,9 @@ Ptr<Retina> Retina::create(Size inputSize) ...@@ -311,9 +311,9 @@ Ptr<Retina> Retina::create(Size inputSize)
return makePtr<RetinaImpl>(inputSize); return makePtr<RetinaImpl>(inputSize);
} }
Ptr<Retina> Retina::create(Size inputSize, const bool colorMode, int colorSamplingMethod, const bool useRetinaLogSampling, const float reductionFactor, const float samplingStrenght) Ptr<Retina> Retina::create(Size inputSize, const bool colorMode, int colorSamplingMethod, const bool useRetinaLogSampling, const float reductionFactor, const float samplingStrength)
{ {
return makePtr<RetinaImpl>(inputSize, colorMode, colorSamplingMethod, useRetinaLogSampling, reductionFactor, samplingStrenght); return makePtr<RetinaImpl>(inputSize, colorMode, colorSamplingMethod, useRetinaLogSampling, reductionFactor, samplingStrength);
} }
...@@ -327,13 +327,13 @@ RetinaImpl::RetinaImpl(const cv::Size inputSz) ...@@ -327,13 +327,13 @@ RetinaImpl::RetinaImpl(const cv::Size inputSz)
#endif #endif
} }
RetinaImpl::RetinaImpl(const cv::Size inputSz, const bool colorMode, int colorSamplingMethod, const bool useRetinaLogSampling, const float reductionFactor, const float samplingStrenght) RetinaImpl::RetinaImpl(const cv::Size inputSz, const bool colorMode, int colorSamplingMethod, const bool useRetinaLogSampling, const float reductionFactor, const float samplingStrength)
{ {
_init(inputSz, colorMode, colorSamplingMethod, useRetinaLogSampling, reductionFactor, samplingStrenght); _init(inputSz, colorMode, colorSamplingMethod, useRetinaLogSampling, reductionFactor, samplingStrength);
#ifdef HAVE_OPENCL #ifdef HAVE_OPENCL
if (inputSz.width % 4 == 0 && !useRetinaLogSampling && cv::ocl::useOpenCL()) if (inputSz.width % 4 == 0 && !useRetinaLogSampling && cv::ocl::useOpenCL())
_ocl_retina.reset(new ocl::RetinaOCLImpl(inputSz, colorMode, colorSamplingMethod, _ocl_retina.reset(new ocl::RetinaOCLImpl(inputSz, colorMode, colorSamplingMethod,
useRetinaLogSampling, reductionFactor, samplingStrenght)); useRetinaLogSampling, reductionFactor, samplingStrength));
#endif #endif
} }
...@@ -712,7 +712,7 @@ const Mat RetinaImpl::getParvoRAW() const { ...@@ -712,7 +712,7 @@ const Mat RetinaImpl::getParvoRAW() const {
} }
// private method called by constructors // private method called by constructors
void RetinaImpl::_init(const cv::Size inputSz, const bool colorMode, int colorSamplingMethod, const bool useRetinaLogSampling, const float reductionFactor, const float samplingStrenght) void RetinaImpl::_init(const cv::Size inputSz, const bool colorMode, int colorSamplingMethod, const bool useRetinaLogSampling, const float reductionFactor, const float samplingStrength)
{ {
_wasOCLRunCalled = false; _wasOCLRunCalled = false;
// basic error check // basic error check
...@@ -724,7 +724,7 @@ void RetinaImpl::_init(const cv::Size inputSz, const bool colorMode, int colorSa ...@@ -724,7 +724,7 @@ void RetinaImpl::_init(const cv::Size inputSz, const bool colorMode, int colorSa
_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...)
// allocate the retina model // allocate the retina model
_retinaFilter.reset(new RetinaFilter(inputSz.height, inputSz.width, colorMode, colorSamplingMethod, useRetinaLogSampling, reductionFactor, samplingStrenght)); _retinaFilter.reset(new RetinaFilter(inputSz.height, inputSz.width, colorMode, colorSamplingMethod, useRetinaLogSampling, reductionFactor, samplingStrength));
_retinaParameters.OPLandIplParvo.colorMode = colorMode; _retinaParameters.OPLandIplParvo.colorMode = colorMode;
// prepare the default parameter XML file with default setup // prepare the default parameter XML file with default setup
......
...@@ -81,9 +81,9 @@ RetinaOCLImpl::RetinaOCLImpl(const cv::Size inputSz) ...@@ -81,9 +81,9 @@ RetinaOCLImpl::RetinaOCLImpl(const cv::Size inputSz)
_init(inputSz, true, RETINA_COLOR_BAYER, false); _init(inputSz, true, RETINA_COLOR_BAYER, false);
} }
RetinaOCLImpl::RetinaOCLImpl(const cv::Size inputSz, const bool colorMode, int colorSamplingMethod, const bool useRetinaLogSampling, const double reductionFactor, const double samplingStrenght) RetinaOCLImpl::RetinaOCLImpl(const cv::Size inputSz, const bool colorMode, int colorSamplingMethod, const bool useRetinaLogSampling, const double reductionFactor, const double samplingStrength)
{ {
_init(inputSz, colorMode, colorSamplingMethod, useRetinaLogSampling, reductionFactor, samplingStrenght); _init(inputSz, colorMode, colorSamplingMethod, useRetinaLogSampling, reductionFactor, samplingStrength);
} }
RetinaOCLImpl::~RetinaOCLImpl() RetinaOCLImpl::~RetinaOCLImpl()
...@@ -347,7 +347,7 @@ void RetinaOCLImpl::getMagno(OutputArray output) ...@@ -347,7 +347,7 @@ void RetinaOCLImpl::getMagno(OutputArray output)
output.assign(retinaOutput_magno); output.assign(retinaOutput_magno);
} }
// private method called by constructors // private method called by constructors
void RetinaOCLImpl::_init(const cv::Size inputSz, const bool colorMode, int colorSamplingMethod, const bool useRetinaLogSampling, const double reductionFactor, const double samplingStrenght) void RetinaOCLImpl::_init(const cv::Size inputSz, const bool colorMode, int colorSamplingMethod, const bool useRetinaLogSampling, const double reductionFactor, const double samplingStrength)
{ {
// basic error check // basic error check
if (inputSz.height*inputSz.width <= 0) if (inputSz.height*inputSz.width <= 0)
...@@ -356,7 +356,7 @@ void RetinaOCLImpl::_init(const cv::Size inputSz, const bool colorMode, int colo ...@@ -356,7 +356,7 @@ void RetinaOCLImpl::_init(const cv::Size inputSz, const bool colorMode, int colo
} }
// allocate the retina model // allocate the retina model
_retinaFilter.reset(new RetinaFilter(inputSz.height, inputSz.width, colorMode, colorSamplingMethod, useRetinaLogSampling, reductionFactor, samplingStrenght)); _retinaFilter.reset(new RetinaFilter(inputSz.height, inputSz.width, colorMode, colorSamplingMethod, useRetinaLogSampling, reductionFactor, samplingStrength));
// prepare the default parameter XML file with default setup // prepare the default parameter XML file with default setup
setup(_retinaParameters); setup(_retinaParameters);
......
...@@ -397,7 +397,7 @@ protected: ...@@ -397,7 +397,7 @@ protected:
class RetinaFilter class RetinaFilter
{ {
public: public:
RetinaFilter(const unsigned int sizeRows, const unsigned int sizeColumns, const bool colorMode = false, const int samplingMethod = RETINA_COLOR_BAYER, const bool useRetinaLogSampling = false, const double reductionFactor = 1.0, const double samplingStrenght = 10.0); RetinaFilter(const unsigned int sizeRows, const unsigned int sizeColumns, const bool colorMode = false, const int samplingMethod = RETINA_COLOR_BAYER, const bool useRetinaLogSampling = false, const double reductionFactor = 1.0, const double samplingStrength = 10.0);
~RetinaFilter(); ~RetinaFilter();
void clearAllBuffers(); void clearAllBuffers();
...@@ -631,7 +631,7 @@ class RetinaOCLImpl CV_FINAL : public Retina ...@@ -631,7 +631,7 @@ class RetinaOCLImpl CV_FINAL : public Retina
{ {
public: public:
RetinaOCLImpl(Size getInputSize); RetinaOCLImpl(Size getInputSize);
RetinaOCLImpl(Size getInputSize, const bool colorMode, int colorSamplingMethod = RETINA_COLOR_BAYER, const bool useRetinaLogSampling = false, const double reductionFactor = 1.0, const double samplingStrenght = 10.0); RetinaOCLImpl(Size getInputSize, const bool colorMode, int colorSamplingMethod = RETINA_COLOR_BAYER, const bool useRetinaLogSampling = false, const double reductionFactor = 1.0, const double samplingStrength = 10.0);
virtual ~RetinaOCLImpl() CV_OVERRIDE; virtual ~RetinaOCLImpl() CV_OVERRIDE;
Size getInputSize() CV_OVERRIDE; Size getInputSize() CV_OVERRIDE;
...@@ -672,7 +672,7 @@ protected: ...@@ -672,7 +672,7 @@ protected:
cv::Ptr<RetinaFilter> _retinaFilter; cv::Ptr<RetinaFilter> _retinaFilter;
bool convertToColorPlanes(const UMat& input, UMat &output); bool convertToColorPlanes(const UMat& input, UMat &output);
void convertToInterleaved(const UMat& input, bool colorMode, UMat &output); void convertToInterleaved(const UMat& input, bool colorMode, UMat &output);
void _init(const Size getInputSize, const bool colorMode, int colorSamplingMethod = RETINA_COLOR_BAYER, const bool useRetinaLogSampling = false, const double reductionFactor = 1.0, const double samplingStrenght = 10.0); void _init(const Size getInputSize, const bool colorMode, int colorSamplingMethod = RETINA_COLOR_BAYER, const bool useRetinaLogSampling = false, const double reductionFactor = 1.0, const double samplingStrength = 10.0);
}; };
} /* namespace ocl */ } /* namespace ocl */
......
...@@ -76,7 +76,7 @@ namespace cv ...@@ -76,7 +76,7 @@ namespace cv
namespace bioinspired namespace bioinspired
{ {
// standard constructor without any log sampling of the input frame // standard constructor without any log sampling of the input frame
RetinaFilter::RetinaFilter(const unsigned int sizeRows, const unsigned int sizeColumns, const bool colorMode, const int samplingMethod, const bool useRetinaLogSampling, const double reductionFactor, const double samplingStrenght) RetinaFilter::RetinaFilter(const unsigned int sizeRows, const unsigned int sizeColumns, const bool colorMode, const int samplingMethod, const bool useRetinaLogSampling, const double reductionFactor, const double samplingStrength)
: :
_retinaParvoMagnoMappedFrame(0), _retinaParvoMagnoMappedFrame(0),
_retinaParvoMagnoMapCoefTable(0), _retinaParvoMagnoMapCoefTable(0),
...@@ -94,7 +94,7 @@ namespace bioinspired ...@@ -94,7 +94,7 @@ namespace bioinspired
if (useRetinaLogSampling) if (useRetinaLogSampling)
{ {
_photoreceptorsLogSampling = new ImageLogPolProjection(sizeRows, sizeColumns, ImageLogPolProjection::RETINALOGPROJECTION, true); _photoreceptorsLogSampling = new ImageLogPolProjection(sizeRows, sizeColumns, ImageLogPolProjection::RETINALOGPROJECTION, true);
if (!_photoreceptorsLogSampling->initProjection(reductionFactor, samplingStrenght)) if (!_photoreceptorsLogSampling->initProjection(reductionFactor, samplingStrength))
{ {
std::cerr<<"RetinaFilter::Problem initializing photoreceptors log sampling, could not setup retina filter"<<std::endl; std::cerr<<"RetinaFilter::Problem initializing photoreceptors log sampling, could not setup retina filter"<<std::endl;
delete _photoreceptorsLogSampling; delete _photoreceptorsLogSampling;
......
...@@ -125,9 +125,9 @@ public: ...@@ -125,9 +125,9 @@ public:
* @param samplingMethod: specifies which kind of color sampling will be used * @param samplingMethod: specifies which kind of color sampling will be used
* @param useRetinaLogSampling: activate retina log sampling, if true, the 2 following parameters can be used * @param useRetinaLogSampling: activate retina log sampling, if true, the 2 following parameters can be used
* @param reductionFactor: only usefull if param useRetinaLogSampling=true, specifies the reduction factor of the output frame (as the center (fovea) is high resolution and corners can be underscaled, then a reduction of the output is allowed without precision leak * @param reductionFactor: only usefull if param useRetinaLogSampling=true, specifies the reduction factor of the output frame (as the center (fovea) is high resolution and corners can be underscaled, then a reduction of the output is allowed without precision leak
* @param samplingStrenght: only usefull if param useRetinaLogSampling=true, specifies the strenght of the log scale that is applied * @param samplingStrength: only usefull if param useRetinaLogSampling=true, specifies the strength of the log scale that is applied
*/ */
RetinaFilter(const unsigned int sizeRows, const unsigned int sizeColumns, const bool colorMode=false, const int samplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const double reductionFactor=1.0, const double samplingStrenght=10.0); RetinaFilter(const unsigned int sizeRows, const unsigned int sizeColumns, const bool colorMode=false, const int samplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const double reductionFactor=1.0, const double samplingStrength=10.0);
/** /**
* standard destructor * standard destructor
......
...@@ -280,7 +280,7 @@ public: ...@@ -280,7 +280,7 @@ public:
/** /**
* sigmoide image normalization function (saturates min and max values) * sigmoide image normalization function (saturates min and max values)
* @param meanValue: specifies the mean value of th pixels to be processed * @param meanValue: specifies the mean value of th pixels to be processed
* @param sensitivity: strenght of the sigmoide * @param sensitivity: strength of the sigmoide
* @param inputPicture: the image to be normalized if no parameter, then, the built in buffer reachable by getOutput() function is normalized * @param inputPicture: the image to be normalized if no parameter, then, the built in buffer reachable by getOutput() function is normalized
* @param outputBuffer: the ouput buffer on which the result is writed, if no parameter, then, the built in buffer reachable by getOutput() function is normalized * @param outputBuffer: the ouput buffer on which the result is writed, if no parameter, then, the built in buffer reachable by getOutput() function is normalized
* @param maxOutputValue: the maximum output value * @param maxOutputValue: the maximum output value
...@@ -290,7 +290,7 @@ public: ...@@ -290,7 +290,7 @@ public:
/** /**
* sigmoide image normalization function on the current buffer (saturates min and max values) * sigmoide image normalization function on the current buffer (saturates min and max values)
* @param meanValue: specifies the mean value of th pixels to be processed * @param meanValue: specifies the mean value of th pixels to be processed
* @param sensitivity: strenght of the sigmoide * @param sensitivity: strength of the sigmoide
* @param maxOutputValue: the maximum output value * @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) { CV_UNUSED(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) { CV_UNUSED(maxOutputValue); normalizeGrayOutputCentredSigmoide(meanValue, sensitivity, 255.0, this->Buffer(), this->Buffer(), this->getNBpixels()); }
...@@ -299,7 +299,7 @@ public: ...@@ -299,7 +299,7 @@ public:
* 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 * 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
* @param inputPicture: the image to be normalized if no parameter, then, the built in buffer reachable by getOutput() function is normalized * @param inputPicture: the image to be normalized if no parameter, then, the built in buffer reachable by getOutput() function is normalized
* @param outputBuffer: the ouput buffer on which the result is writed, if no parameter, then, the built in buffer reachable by getOutput() function is normalized * @param outputBuffer: the ouput buffer on which the result is writed, if no parameter, then, the built in buffer reachable by getOutput() function is normalized
* @param sensitivity: strenght of the sigmoide * @param sensitivity: strength of the sigmoide
* @param maxOutputValue: the maximum output value * @param maxOutputValue: the maximum output value
*/ */
void normalizeGrayOutputNearZeroCentreredSigmoide(type *inputPicture=(type*)NULL, type *outputBuffer=(type*)NULL, const type sensitivity=(type)40, const type maxOutputValue=(type)255.0); void normalizeGrayOutputNearZeroCentreredSigmoide(type *inputPicture=(type*)NULL, type *outputBuffer=(type*)NULL, const type sensitivity=(type)40, const type maxOutputValue=(type)255.0);
......
...@@ -65,7 +65,7 @@ using namespace cv::text; ...@@ -65,7 +65,7 @@ using namespace cv::text;
size_t edit_distance(const string& A, const string& B); size_t edit_distance(const string& A, const string& B);
size_t min(size_t x, size_t y, size_t z); size_t min(size_t x, size_t y, size_t z);
bool isRepetitive(const string& s); bool isRepetitive(const string& s);
bool sort_by_lenght(const string &a, const string &b); bool sort_by_length(const string &a, const string &b);
//Draw ER's in an image via floodFill //Draw ER's in an image via floodFill
void er_draw(vector<Mat> &channels, vector<vector<ERStat> > &regions, vector<Vec2i> group, Mat& segmentation); void er_draw(vector<Mat> &channels, vector<vector<ERStat> > &regions, vector<Vec2i> group, Mat& segmentation);
...@@ -99,7 +99,7 @@ size_t edit_distance(const string& A, const string& B) ...@@ -99,7 +99,7 @@ size_t edit_distance(const string& A, const string& B)
return M[A.size()][B.size()]; return M[A.size()][B.size()];
} }
bool sort_by_lenght(const string &a, const string &b){return (a.size()>b.size());} bool sort_by_length(const string &a, const string &b){return (a.size()>b.size());}
bool isRepetitive(const string& s) bool isRepetitive(const string& s)
{ {
......
...@@ -65,7 +65,7 @@ using namespace cv::text; ...@@ -65,7 +65,7 @@ using namespace cv::text;
size_t edit_distance(const string& A, const string& B); size_t edit_distance(const string& A, const string& B);
size_t min(size_t x, size_t y, size_t z); size_t min(size_t x, size_t y, size_t z);
bool isRepetitive(const string& s); bool isRepetitive(const string& s);
bool sort_by_lenght(const string &a, const string &b); bool sort_by_length(const string &a, const string &b);
//Draw ER's in an image via floodFill //Draw ER's in an image via floodFill
void er_draw(vector<Mat> &channels, vector<vector<ERStat> > &regions, vector<Vec2i> group, Mat& segmentation); void er_draw(vector<Mat> &channels, vector<vector<ERStat> > &regions, vector<Vec2i> group, Mat& segmentation);
...@@ -99,7 +99,7 @@ size_t edit_distance(const string& A, const string& B) ...@@ -99,7 +99,7 @@ size_t edit_distance(const string& A, const string& B)
return M[A.size()][B.size()]; return M[A.size()][B.size()];
} }
bool sort_by_lenght(const string &a, const string &b){return (a.size()>b.size());} bool sort_by_length(const string &a, const string &b){return (a.size()>b.size());}
bool isRepetitive(const string& s) bool isRepetitive(const string& s)
{ {
......
...@@ -71,7 +71,7 @@ Finally, the obtained results will be shown in Viz, in this case reproducing the ...@@ -71,7 +71,7 @@ Finally, the obtained results will be shown in Viz, in this case reproducing the
Usage and Results Usage and Results
----------------- -----------------
In order to run this sample we need to specify the path to the tracked points file, the focal lenght of the camera in addition to the center projection coordinates (in pixels). You can find a sample file in samples/data/desktop_trakcks.txt In order to run this sample we need to specify the path to the tracked points file, the focal length of the camera in addition to the center projection coordinates (in pixels). You can find a sample file in samples/data/desktop_trakcks.txt
@code{.bash} @code{.bash}
./example_sfm_trajectory_reconstruction desktop_tracks.txt 1914 640 360 ./example_sfm_trajectory_reconstruction desktop_tracks.txt 1914 640 360
......
...@@ -24,7 +24,7 @@ using namespace cv::text; ...@@ -24,7 +24,7 @@ using namespace cv::text;
size_t edit_distance(const string& A, const string& B); size_t edit_distance(const string& A, const string& B);
size_t min(size_t x, size_t y, size_t z); size_t min(size_t x, size_t y, size_t z);
bool isRepetitive(const string& s); bool isRepetitive(const string& s);
bool sort_by_lenght(const string &a, const string &b); bool sort_by_length(const string &a, const string &b);
//Draw ER's in an image via floodFill //Draw ER's in an image via floodFill
void er_draw(vector<Mat> &channels, vector<vector<ERStat> > &regions, vector<Vec2i> group, Mat& segmentation); void er_draw(vector<Mat> &channels, vector<vector<ERStat> > &regions, vector<Vec2i> group, Mat& segmentation);
...@@ -190,7 +190,7 @@ int main(int argc, char* argv[]) ...@@ -190,7 +190,7 @@ int main(int argc, char* argv[])
else else
{ {
sort(words_gt.begin(),words_gt.end(),sort_by_lenght); sort(words_gt.begin(),words_gt.end(),sort_by_length);
int max_dist=0; int max_dist=0;
vector< vector<int> > assignment_mat; vector< vector<int> > assignment_mat;
...@@ -340,4 +340,4 @@ void er_draw(vector<Mat> &channels, vector<vector<ERStat> > &regions, vector<Vec ...@@ -340,4 +340,4 @@ void er_draw(vector<Mat> &channels, vector<vector<ERStat> > &regions, vector<Vec
} }
} }
bool sort_by_lenght(const string &a, const string &b){return (a.size()>b.size());} bool sort_by_length(const string &a, const string &b){return (a.size()>b.size());}
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