diff --git a/modules/contrib/src/hybridtracker.cpp b/modules/contrib/src/hybridtracker.cpp index eb750e8602..010ed1a7f2 100644 --- a/modules/contrib/src/hybridtracker.cpp +++ b/modules/contrib/src/hybridtracker.cpp @@ -199,15 +199,15 @@ void CvHybridTracker::updateTrackerWithEM(Mat image) { for (int i = 0; i < proj.rows; i++) for (int j = 0; j < proj.cols; j++) if (proj.at (i, j) > 0) { - samples->data.fl[count * 2] = i; - samples->data.fl[count * 2 + 1] = j; + samples->data.fl[count * 2] = (float)i; + samples->data.fl[count * 2 + 1] = (float)j; count++; } em_model.train(samples, 0, params.em_params, labels); - curr_center.x = em_model.getMeans().at (0, 0); - curr_center.y = em_model.getMeans().at (0, 1); + curr_center.x = (float)em_model.getMeans().at (0, 0); + curr_center.y = (float)em_model.getMeans().at (0, 1); } void CvHybridTracker::updateTrackerWithLowPassFilter(Mat image) { diff --git a/modules/contrib/src/retinafilter.cpp b/modules/contrib/src/retinafilter.cpp index 4401523d8a..18413145bd 100644 --- a/modules/contrib/src/retinafilter.cpp +++ b/modules/contrib/src/retinafilter.cpp @@ -73,459 +73,457 @@ namespace cv { -// standard constructor without any log sampling of the input frame -RetinaFilter::RetinaFilter(const unsigned int sizeRows, const unsigned int sizeColumns, const bool colorMode, const RETINA_COLORSAMPLINGMETHOD samplingMethod, const bool useRetinaLogSampling, const double reductionFactor, const double samplingStrenght) -: - _retinaParvoMagnoMappedFrame(0), - _retinaParvoMagnoMapCoefTable(0), - _photoreceptorsPrefilter((1-(int)useRetinaLogSampling)*sizeRows+useRetinaLogSampling*ImageLogPolProjection::predictOutputSize(sizeRows, reductionFactor), (1-(int)useRetinaLogSampling)*sizeColumns+useRetinaLogSampling*ImageLogPolProjection::predictOutputSize(sizeColumns, reductionFactor), 4), - _ParvoRetinaFilter((1-(int)useRetinaLogSampling)*sizeRows+useRetinaLogSampling*ImageLogPolProjection::predictOutputSize(sizeRows, reductionFactor), (1-(int)useRetinaLogSampling)*sizeColumns+useRetinaLogSampling*ImageLogPolProjection::predictOutputSize(sizeColumns, reductionFactor)), - _MagnoRetinaFilter((1-(int)useRetinaLogSampling)*sizeRows+useRetinaLogSampling*ImageLogPolProjection::predictOutputSize(sizeRows, reductionFactor), (1-(int)useRetinaLogSampling)*sizeColumns+useRetinaLogSampling*ImageLogPolProjection::predictOutputSize(sizeColumns, reductionFactor)), - _colorEngine((1-(int)useRetinaLogSampling)*sizeRows+useRetinaLogSampling*ImageLogPolProjection::predictOutputSize(sizeRows, reductionFactor), (1-(int)useRetinaLogSampling)*sizeColumns+useRetinaLogSampling*ImageLogPolProjection::predictOutputSize(sizeColumns, reductionFactor), samplingMethod), - // configure retina photoreceptors log sampling... if necessary - _photoreceptorsLogSampling(NULL) -{ + // standard constructor without any log sampling of the input frame + RetinaFilter::RetinaFilter(const unsigned int sizeRows, const unsigned int sizeColumns, const bool colorMode, const RETINA_COLORSAMPLINGMETHOD samplingMethod, const bool useRetinaLogSampling, const double reductionFactor, const double samplingStrenght) + : + _retinaParvoMagnoMappedFrame(0), + _retinaParvoMagnoMapCoefTable(0), + _photoreceptorsPrefilter((1-(int)useRetinaLogSampling)*sizeRows+useRetinaLogSampling*ImageLogPolProjection::predictOutputSize(sizeRows, reductionFactor), (1-(int)useRetinaLogSampling)*sizeColumns+useRetinaLogSampling*ImageLogPolProjection::predictOutputSize(sizeColumns, reductionFactor), 4), + _ParvoRetinaFilter((1-(int)useRetinaLogSampling)*sizeRows+useRetinaLogSampling*ImageLogPolProjection::predictOutputSize(sizeRows, reductionFactor), (1-(int)useRetinaLogSampling)*sizeColumns+useRetinaLogSampling*ImageLogPolProjection::predictOutputSize(sizeColumns, reductionFactor)), + _MagnoRetinaFilter((1-(int)useRetinaLogSampling)*sizeRows+useRetinaLogSampling*ImageLogPolProjection::predictOutputSize(sizeRows, reductionFactor), (1-(int)useRetinaLogSampling)*sizeColumns+useRetinaLogSampling*ImageLogPolProjection::predictOutputSize(sizeColumns, reductionFactor)), + _colorEngine((1-(int)useRetinaLogSampling)*sizeRows+useRetinaLogSampling*ImageLogPolProjection::predictOutputSize(sizeRows, reductionFactor), (1-(int)useRetinaLogSampling)*sizeColumns+useRetinaLogSampling*ImageLogPolProjection::predictOutputSize(sizeColumns, reductionFactor), samplingMethod), + // configure retina photoreceptors log sampling... if necessary + _photoreceptorsLogSampling(NULL) + { #ifdef RETINADEBUG - std::cout<<"RetinaFilter::size( "<<_photoreceptorsPrefilter.getNBrows()<<", "<<_photoreceptorsPrefilter.getNBcolumns()<<")"<<" =? "<<_photoreceptorsPrefilter.getNBpixels()<initProjection(reductionFactor, samplingStrenght)) - { - std::cerr<<"RetinaFilter::Problem initializing photoreceptors log sampling, could not setup retina filter"<initProjection(reductionFactor, samplingStrenght)) + { + std::cerr<<"RetinaFilter::Problem initializing photoreceptors log sampling, could not setup retina filter"<getNBrows()<<", "<<_photoreceptorsLogSampling->getNBcolumns()<<")"<<" =? "<<_photoreceptorsLogSampling->getNBpixels()<getNBrows()<<", "<<_photoreceptorsLogSampling->getNBcolumns()<<")"<<" =? "<<_photoreceptorsLogSampling->getNBpixels()<getNBrows()<<", "<getNBcolumns()<<")"<<_filterOutput.size()<<" =? "<<_filterOutput.getNBpixels()<clearAllBuffers(); - // stability controls value init - _setInitPeriodCount(); -} - -/** -* resize retina filter object (resize all allocated buffers -* @param NBrows: the new height size -* @param NBcolumns: the new width size -*/ -void RetinaFilter::resize(const unsigned int NBrows, const unsigned int NBcolumns) -{ - unsigned int rows=NBrows, cols=NBcolumns; - - // resize optionnal member and adjust other modules size if required - if (_photoreceptorsLogSampling) - { - _photoreceptorsLogSampling->resize(NBrows, NBcolumns); - rows=_photoreceptorsLogSampling->getOutputNBrows(); - cols=_photoreceptorsLogSampling->getOutputNBcolumns(); - } - - _photoreceptorsPrefilter.resize(rows, cols); - _ParvoRetinaFilter.resize(rows, cols); - _MagnoRetinaFilter.resize(rows, cols); - _colorEngine.resize(rows, cols); - - // reset parvo magno mapping - _createHybridTable(); - - // clean buffers - clearAllBuffers(); - -} - -// stability controls value init -void RetinaFilter::_setInitPeriodCount() -{ - - // find out the maximum temporal constant value and apply a security factor - // false value (obviously too long) but appropriate for simple use - _globalTemporalConstant=(unsigned int)(_ParvoRetinaFilter.getPhotoreceptorsTemporalConstant()+_ParvoRetinaFilter.getHcellsTemporalConstant()+_MagnoRetinaFilter.getTemporalConstant()); - // reset frame counter - _ellapsedFramesSinceLastReset=0; -} - -void RetinaFilter::_createHybridTable() -{ - // create hybrid output and related coefficient table - _retinaParvoMagnoMappedFrame.resize(_photoreceptorsPrefilter.getNBpixels()); - - _retinaParvoMagnoMapCoefTable.resize(_photoreceptorsPrefilter.getNBpixels()*2); - - // fill _hybridParvoMagnoCoefTable - int i, j, halfRows=_photoreceptorsPrefilter.getNBrows()/2, halfColumns=_photoreceptorsPrefilter.getNBcolumns()/2; - float *hybridParvoMagnoCoefTablePTR= &_retinaParvoMagnoMapCoefTable[0]; - float minDistance=(float)MIN(halfRows, halfColumns)*0.7; - for (i=0;i<(int)_photoreceptorsPrefilter.getNBrows();++i) - { - for (j=0;j<(int)_photoreceptorsPrefilter.getNBcolumns();++j) - { - float distanceToCenter=sqrt(((float)(i-halfRows)*(i-halfRows)+(j-halfColumns)*(j-halfColumns))); - if (distanceToCentersetV0CompressionParameter(0.6, maxInputValue, meanValue); // keeps log compression sensitivity parameter (usefull for the tone mapping function) - _ParvoRetinaFilter.setOPLandParvoFiltersParameters(0,OPLtemporalresponse1, OPLspatialResponse1, OPLassymetryGain, OPLtemporalresponse2, OPLspatialResponse2); - _ParvoRetinaFilter.setV0CompressionParameter(0.9, maxInputValue, meanValue); - _MagnoRetinaFilter.setCoefficientsTable(LPfilterGain, LPfilterTemporalresponse, LPfilterSpatialResponse, MovingContoursExtractorCoefficient, 0, 2.0*LPfilterSpatialResponse); - _MagnoRetinaFilter.setV0CompressionParameter(0.7, maxInputValue, meanValue); - - // stability controls value init - _setInitPeriodCount(); -} - -const bool RetinaFilter::checkInput(const std::valarray &input, const bool) -{ - - BasicRetinaFilter *inputTarget=&_photoreceptorsPrefilter; - if (_photoreceptorsLogSampling) - inputTarget=_photoreceptorsLogSampling; - - bool test=input.size()==inputTarget->getNBpixels() || input.size()==(inputTarget->getNBpixels()*3) ; - if (!test) - { - std::cerr<<"RetinaFilter::checkInput: input buffer does not match retina buffer size, conversion aborted"< &bufferInput=checkInput(LMSimageInput, true); - if (!bufferInput) - return NULL; - - if (!_useColorMode) - std::cerr<<"RetinaFilter::Can not call tone mapping oeration if the retina filter was created for gray scale images"< lmsTempBuffer(LMSimageInput); - std::cout<<"RetinaFilter::--->min LMS value="<L - _spatiotemporalLPfilter(LMSimageInput, _filterOutput, 1); - setV0CompressionParameterToneMapping(PhotoreceptorsCompression, _maxInputValue, this->sum()/_NBpixels); - _localLuminanceAdaptation(LMSimageInput, _filterOutput, lmsTempBuffer.Buffer()); - // ->M - _spatiotemporalLPfilter(LMSimageInput+_NBpixels, _filterOutput, 1); - setV0CompressionParameterToneMapping(PhotoreceptorsCompression, _maxInputValue, this->sum()/_NBpixels); - _localLuminanceAdaptation(LMSimageInput+_NBpixels, _filterOutput, lmsTempBuffer.Buffer()+_NBpixels); - // ->S - _spatiotemporalLPfilter(LMSimageInput+_NBpixels*2, _filterOutput, 1); - setV0CompressionParameterToneMapping(PhotoreceptorsCompression, _maxInputValue, this->sum()/_NBpixels); - _localLuminanceAdaptation(LMSimageInput+_NBpixels*2, _filterOutput, lmsTempBuffer.Buffer()+_NBpixels*2); - - // eliminate negative values - for (unsigned int i=0;igetNBrows()<<", "<getNBcolumns()<<")"<<_filterOutput.size()<<" =? "<<_filterOutput.getNBpixels()<clearAllBuffers(); + // stability controls value init + _setInitPeriodCount(); + } + + /** + * resize retina filter object (resize all allocated buffers + * @param NBrows: the new height size + * @param NBcolumns: the new width size + */ + void RetinaFilter::resize(const unsigned int NBrows, const unsigned int NBcolumns) + { + unsigned int rows=NBrows, cols=NBcolumns; + + // resize optionnal member and adjust other modules size if required + if (_photoreceptorsLogSampling) + { + _photoreceptorsLogSampling->resize(NBrows, NBcolumns); + rows=_photoreceptorsLogSampling->getOutputNBrows(); + cols=_photoreceptorsLogSampling->getOutputNBcolumns(); + } + + _photoreceptorsPrefilter.resize(rows, cols); + _ParvoRetinaFilter.resize(rows, cols); + _MagnoRetinaFilter.resize(rows, cols); + _colorEngine.resize(rows, cols); + + // reset parvo magno mapping + _createHybridTable(); + + // clean buffers + clearAllBuffers(); + + } + + // stability controls value init + void RetinaFilter::_setInitPeriodCount() + { + + // find out the maximum temporal constant value and apply a security factor + // false value (obviously too long) but appropriate for simple use + _globalTemporalConstant=(unsigned int)(_ParvoRetinaFilter.getPhotoreceptorsTemporalConstant()+_ParvoRetinaFilter.getHcellsTemporalConstant()+_MagnoRetinaFilter.getTemporalConstant()); + // reset frame counter + _ellapsedFramesSinceLastReset=0; + } + + void RetinaFilter::_createHybridTable() + { + // create hybrid output and related coefficient table + _retinaParvoMagnoMappedFrame.resize(_photoreceptorsPrefilter.getNBpixels()); + + _retinaParvoMagnoMapCoefTable.resize(_photoreceptorsPrefilter.getNBpixels()*2); + + // fill _hybridParvoMagnoCoefTable + int i, j, halfRows=_photoreceptorsPrefilter.getNBrows()/2, halfColumns=_photoreceptorsPrefilter.getNBcolumns()/2; + float *hybridParvoMagnoCoefTablePTR= &_retinaParvoMagnoMapCoefTable[0]; + float minDistance=(float)MIN(halfRows, halfColumns)*0.7; + for (i=0;i<(int)_photoreceptorsPrefilter.getNBrows();++i) + { + for (j=0;j<(int)_photoreceptorsPrefilter.getNBcolumns();++j) + { + float distanceToCenter=sqrt(((float)(i-halfRows)*(i-halfRows)+(j-halfColumns)*(j-halfColumns))); + if (distanceToCentersetV0CompressionParameter(0.6, maxInputValue, meanValue); // keeps log compression sensitivity parameter (usefull for the tone mapping function) + _ParvoRetinaFilter.setOPLandParvoFiltersParameters(0,OPLtemporalresponse1, OPLspatialResponse1, OPLassymetryGain, OPLtemporalresponse2, OPLspatialResponse2); + _ParvoRetinaFilter.setV0CompressionParameter(0.9, maxInputValue, meanValue); + _MagnoRetinaFilter.setCoefficientsTable(LPfilterGain, LPfilterTemporalresponse, LPfilterSpatialResponse, MovingContoursExtractorCoefficient, 0, 2.0*LPfilterSpatialResponse); + _MagnoRetinaFilter.setV0CompressionParameter(0.7, maxInputValue, meanValue); + + // stability controls value init + _setInitPeriodCount(); + } + + const bool RetinaFilter::checkInput(const std::valarray &input, const bool) + { + + BasicRetinaFilter *inputTarget=&_photoreceptorsPrefilter; + if (_photoreceptorsLogSampling) + inputTarget=_photoreceptorsLogSampling; + + bool test=input.size()==inputTarget->getNBpixels() || input.size()==(inputTarget->getNBpixels()*3) ; + if (!test) + { + std::cerr<<"RetinaFilter::checkInput: input buffer does not match retina buffer size, conversion aborted"< &bufferInput=checkInput(LMSimageInput, true); + if (!bufferInput) + return NULL; + + if (!_useColorMode) + std::cerr<<"RetinaFilter::Can not call tone mapping oeration if the retina filter was created for gray scale images"< lmsTempBuffer(LMSimageInput); + std::cout<<"RetinaFilter::--->min LMS value="<L + _spatiotemporalLPfilter(LMSimageInput, _filterOutput, 1); + setV0CompressionParameterToneMapping(PhotoreceptorsCompression, _maxInputValue, this->sum()/_NBpixels); + _localLuminanceAdaptation(LMSimageInput, _filterOutput, lmsTempBuffer.Buffer()); + // ->M + _spatiotemporalLPfilter(LMSimageInput+_NBpixels, _filterOutput, 1); + setV0CompressionParameterToneMapping(PhotoreceptorsCompression, _maxInputValue, this->sum()/_NBpixels); + _localLuminanceAdaptation(LMSimageInput+_NBpixels, _filterOutput, lmsTempBuffer.Buffer()+_NBpixels); + // ->S + _spatiotemporalLPfilter(LMSimageInput+_NBpixels*2, _filterOutput, 1); + setV0CompressionParameterToneMapping(PhotoreceptorsCompression, _maxInputValue, this->sum()/_NBpixels); + _localLuminanceAdaptation(LMSimageInput+_NBpixels*2, _filterOutput, lmsTempBuffer.Buffer()+_NBpixels*2); + + // eliminate negative values + for (unsigned int i=0;imin LMS value="<min LMS value="< acr1cr2TempBuffer(_NBrows, _NBcolumns, 3); - memcpy(acr1cr2TempBuffer.Buffer(), lmsTempBuffer.Buffer(), sizeof(float)*_NBpixels*3); + TemplateBuffer acr1cr2TempBuffer(_NBrows, _NBcolumns, 3); + memcpy(acr1cr2TempBuffer.Buffer(), lmsTempBuffer.Buffer(), sizeof(float)*_NBpixels*3); - // compute A Cr1 Cr2 to LMS color space conversion - _applyImageColorSpaceConversion(acr1cr2TempBuffer.Buffer(), lmsTempBuffer.Buffer(), _ACr1Cr2toLMS); + // compute A Cr1 Cr2 to LMS color space conversion + _applyImageColorSpaceConversion(acr1cr2TempBuffer.Buffer(), lmsTempBuffer.Buffer(), _ACr1Cr2toLMS); - // eliminate negative values - for (unsigned int i=0;isetDemultiplexedColorFrame(lmsTempBuffer.Buffer()); - */ -} - -// return image with center Parvo and peripheral Magno channels -void RetinaFilter::_processRetinaParvoMagnoMapping() -{ - register float *hybridParvoMagnoPTR= &_retinaParvoMagnoMappedFrame[0]; - register const float *parvoOutputPTR= get_data(_ParvoRetinaFilter.getOutput()); - register const float *magnoXOutputPTR= get_data(_MagnoRetinaFilter.getOutput()); - register float *hybridParvoMagnoCoefTablePTR= &_retinaParvoMagnoMapCoefTable[0]; - - for (unsigned int i=0 ; i<_photoreceptorsPrefilter.getNBpixels() ; ++i, hybridParvoMagnoCoefTablePTR+=2) - { - float hybridValue=*(parvoOutputPTR++)**(hybridParvoMagnoCoefTablePTR)+*(magnoXOutputPTR++)**(hybridParvoMagnoCoefTablePTR+1); - *(hybridParvoMagnoPTR++)=hybridValue; - } - - TemplateBuffer::normalizeGrayOutput_0_maxOutputValue(&_retinaParvoMagnoMappedFrame[0], _photoreceptorsPrefilter.getNBpixels()); - -} - -const bool RetinaFilter::getParvoFoveaResponse(std::valarray &parvoFovealResponse) -{ - if (!_useParvoOutput) - return false; - if (parvoFovealResponse.size() != _ParvoRetinaFilter.getNBpixels()) - return false; - - register const float *parvoOutputPTR= get_data(_ParvoRetinaFilter.getOutput()); - register float *fovealParvoResponsePTR= &parvoFovealResponse[0]; - register float *hybridParvoMagnoCoefTablePTR= &_retinaParvoMagnoMapCoefTable[0]; - - for (unsigned int i=0 ; i<_photoreceptorsPrefilter.getNBpixels() ; ++i, hybridParvoMagnoCoefTablePTR+=2) - { - *(fovealParvoResponsePTR++)=*(parvoOutputPTR++)**(hybridParvoMagnoCoefTablePTR); - } - - return true; -} - -// method to retrieve the parafoveal magnocellular pathway response (no energy motion in fovea) -const bool RetinaFilter::getMagnoParaFoveaResponse(std::valarray &magnoParafovealResponse) -{ - if (!_useMagnoOutput) - return false; - if (magnoParafovealResponse.size() != _MagnoRetinaFilter.getNBpixels()) - return false; - - register const float *magnoXOutputPTR= get_data(_MagnoRetinaFilter.getOutput()); - register float *parafovealMagnoResponsePTR=&magnoParafovealResponse[0]; - register float *hybridParvoMagnoCoefTablePTR=&_retinaParvoMagnoMapCoefTable[0]+1; - - for (unsigned int i=0 ; i<_photoreceptorsPrefilter.getNBpixels() ; ++i, hybridParvoMagnoCoefTablePTR+=2) - { - *(parafovealMagnoResponsePTR++)=*(magnoXOutputPTR++)**(hybridParvoMagnoCoefTablePTR); - } - - return true; -} - - + // rewrite output to the appropriate buffer + _colorEngine->setDemultiplexedColorFrame(lmsTempBuffer.Buffer()); + */ + } + + // return image with center Parvo and peripheral Magno channels + void RetinaFilter::_processRetinaParvoMagnoMapping() + { + register float *hybridParvoMagnoPTR= &_retinaParvoMagnoMappedFrame[0]; + register const float *parvoOutputPTR= get_data(_ParvoRetinaFilter.getOutput()); + register const float *magnoXOutputPTR= get_data(_MagnoRetinaFilter.getOutput()); + register float *hybridParvoMagnoCoefTablePTR= &_retinaParvoMagnoMapCoefTable[0]; + + for (unsigned int i=0 ; i<_photoreceptorsPrefilter.getNBpixels() ; ++i, hybridParvoMagnoCoefTablePTR+=2) + { + float hybridValue=*(parvoOutputPTR++)**(hybridParvoMagnoCoefTablePTR)+*(magnoXOutputPTR++)**(hybridParvoMagnoCoefTablePTR+1); + *(hybridParvoMagnoPTR++)=hybridValue; + } + + TemplateBuffer::normalizeGrayOutput_0_maxOutputValue(&_retinaParvoMagnoMappedFrame[0], _photoreceptorsPrefilter.getNBpixels()); + + } + + const bool RetinaFilter::getParvoFoveaResponse(std::valarray &parvoFovealResponse) + { + if (!_useParvoOutput) + return false; + if (parvoFovealResponse.size() != _ParvoRetinaFilter.getNBpixels()) + return false; + + register const float *parvoOutputPTR= get_data(_ParvoRetinaFilter.getOutput()); + register float *fovealParvoResponsePTR= &parvoFovealResponse[0]; + register float *hybridParvoMagnoCoefTablePTR= &_retinaParvoMagnoMapCoefTable[0]; + + for (unsigned int i=0 ; i<_photoreceptorsPrefilter.getNBpixels() ; ++i, hybridParvoMagnoCoefTablePTR+=2) + { + *(fovealParvoResponsePTR++)=*(parvoOutputPTR++)**(hybridParvoMagnoCoefTablePTR); + } + + return true; + } + + // method to retrieve the parafoveal magnocellular pathway response (no energy motion in fovea) + const bool RetinaFilter::getMagnoParaFoveaResponse(std::valarray &magnoParafovealResponse) + { + if (!_useMagnoOutput) + return false; + if (magnoParafovealResponse.size() != _MagnoRetinaFilter.getNBpixels()) + return false; + + register const float *magnoXOutputPTR= get_data(_MagnoRetinaFilter.getOutput()); + register float *parafovealMagnoResponsePTR=&magnoParafovealResponse[0]; + register float *hybridParvoMagnoCoefTablePTR=&_retinaParvoMagnoMapCoefTable[0]+1; + + for (unsigned int i=0 ; i<_photoreceptorsPrefilter.getNBpixels() ; ++i, hybridParvoMagnoCoefTablePTR+=2) + { + *(parafovealMagnoResponsePTR++)=*(magnoXOutputPTR++)**(hybridParvoMagnoCoefTablePTR); + } + + return true; + } } diff --git a/modules/core/src/cmdparser.cpp b/modules/core/src/cmdparser.cpp index f67f624ea3..e19c05e2ae 100644 --- a/modules/core/src/cmdparser.cpp +++ b/modules/core/src/cmdparser.cpp @@ -287,25 +287,25 @@ std::string CommandLineParser::analizeValue(const std::string& str, } template<> -int CommandLineParser::analizeValue(const std::string& str, bool space_delete) +int CommandLineParser::analizeValue(const std::string& str, bool /*space_delete*/) { return fromStringNumber(str); } template<> -unsigned int CommandLineParser::analizeValue(const std::string& str, bool space_delete) +unsigned int CommandLineParser::analizeValue(const std::string& str, bool /*space_delete*/) { return fromStringNumber(str); } template<> -float CommandLineParser::analizeValue(const std::string& str, bool space_delete) +float CommandLineParser::analizeValue(const std::string& str, bool /*space_delete*/) { return fromStringNumber(str); } template<> -double CommandLineParser::analizeValue(const std::string& str, bool space_delete) +double CommandLineParser::analizeValue(const std::string& str, bool /*space_delete*/) { return fromStringNumber(str); } diff --git a/modules/core/test/test_operations.cpp b/modules/core/test/test_operations.cpp index 41cc4499e4..6e7968fb02 100644 --- a/modules/core/test/test_operations.cpp +++ b/modules/core/test/test_operations.cpp @@ -780,14 +780,14 @@ bool CV_OperationsTest::TestVec() //these compile cv::Vec3b b = a; - hsvImage_f.at(i,j) = cv::Vec3f(i,0,1); - hsvImage_b.at(i,j) = cv::Vec3b(cv::Vec3f(i,0,1)); + hsvImage_f.at(i,j) = cv::Vec3f((float)i,0,1); + hsvImage_b.at(i,j) = cv::Vec3b(cv::Vec3f((float)i,0,1)); //these don't b = cv::Vec3f(1,0,0); cv::Vec3b c; c = cv::Vec3f(0,0,1); - hsvImage_b.at(i,j) = cv::Vec3f(i,0,1); + hsvImage_b.at(i,j) = cv::Vec3f((float)i,0,1); hsvImage_b.at(i,j) = a; hsvImage_b.at(i,j) = cv::Vec3f(1,2,3); } diff --git a/modules/imgproc/src/phasecorr.cpp b/modules/imgproc/src/phasecorr.cpp index 24b28e4592..fec4d56c37 100644 --- a/modules/imgproc/src/phasecorr.cpp +++ b/modules/imgproc/src/phasecorr.cpp @@ -322,7 +322,7 @@ void cv::createHanningWindow(OutputArray _dst, cv::Size winSize, int type) for(int j = 0; j < cols; j++) { double wc = 0.5 * (1.0f - cos(2.0f * CV_PI * (double)j / (double)(cols - 1))); - dstData[i*cols + j] = wr * wc; + dstData[i*cols + j] = (float)(wr * wc); } }