Ejemplo n.º 1
0
// action function
std::valarray<float> &ImageLogPolProjection::runProjection(const std::valarray<float> &inputFrame, const bool colorMode)
{
    if (_colorModeCapable&&colorMode)
    {
        // progressive filtering and storage of the result in _tempBuffer
        _spatiotemporalLPfilter_Irregular(get_data(inputFrame), &_irregularLPfilteredFrame[0]);
        _spatiotemporalLPfilter_Irregular(&_irregularLPfilteredFrame[0], &_tempBuffer[0]); // warning, temporal issue may occur, if the temporal constant is not NULL !!!

        _spatiotemporalLPfilter_Irregular(get_data(inputFrame)+_filterOutput.getNBpixels(), &_irregularLPfilteredFrame[0]);
        _spatiotemporalLPfilter_Irregular(&_irregularLPfilteredFrame[0], &_tempBuffer[0]+_filterOutput.getNBpixels());

        _spatiotemporalLPfilter_Irregular(get_data(inputFrame)+_filterOutput.getNBpixels()*2, &_irregularLPfilteredFrame[0]);
        _spatiotemporalLPfilter_Irregular(&_irregularLPfilteredFrame[0], &_tempBuffer[0]+_filterOutput.getNBpixels()*2);

        // applying image projection/resampling
        register unsigned int *transformTablePTR=&_transformTable[0];
        for (unsigned int i=0 ; i<_usefullpixelIndex ; i+=2, transformTablePTR+=2)
        {
#ifdef IMAGELOGPOLPROJECTION_DEBUG
            std::cout<<"ImageLogPolProjection::i:"<<i<<"output(max="<<_outputNBpixels<<")="<<_transformTable[i]<<" / intput(max="<<_filterOutput.getNBpixels()<<")="<<_transformTable[i+1]<<std::endl;
#endif
            _sampledFrame[*(transformTablePTR)]=_tempBuffer[*(transformTablePTR+1)];
            _sampledFrame[*(transformTablePTR)+_outputNBpixels]=_tempBuffer[*(transformTablePTR+1)+_filterOutput.getNBpixels()];
            _sampledFrame[*(transformTablePTR)+_outputDoubleNBpixels]=_tempBuffer[*(transformTablePTR+1)+_inputDoubleNBpixels];
        }

#ifdef IMAGELOGPOLPROJECTION_DEBUG
        std::cout<<"ImageLogPolProjection::runProjection: color image projection OK"<<std::endl;
#endif
        //normalizeGrayOutput_0_maxOutputValue(_sampledFrame, _outputNBpixels);
    }else
    {
        _spatiotemporalLPfilter_Irregular(get_data(inputFrame), &_irregularLPfilteredFrame[0]);
        _spatiotemporalLPfilter_Irregular(&_irregularLPfilteredFrame[0], &_irregularLPfilteredFrame[0]);
        // applying image projection/resampling
        register unsigned int *transformTablePTR=&_transformTable[0];
        for (unsigned int i=0 ; i<_usefullpixelIndex ; i+=2, transformTablePTR+=2)
        {
#ifdef IMAGELOGPOLPROJECTION_DEBUG
            std::cout<<"i:"<<i<<"output(max="<<_outputNBpixels<<")="<<_transformTable[i]<<" / intput(max="<<_filterOutput.getNBpixels()<<")="<<_transformTable[i+1]<<std::endl;
#endif
            _sampledFrame[*(transformTablePTR)]=_irregularLPfilteredFrame[*(transformTablePTR+1)];
        }
        //normalizeGrayOutput_0_maxOutputValue(_sampledFrame, _outputNBpixels);
#ifdef IMAGELOGPOLPROJECTION_DEBUG
        std::cout<<"ImageLogPolProjection::runProjection: gray level image projection OK"<<std::endl;
#endif
    }

    return _sampledFrame;
}
Ejemplo n.º 2
0
 /**
 * 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)
 * @param inputFrame: the input image to be processed
 * @param outputFrame: the output buffer in which the result is writen
 * @param filterIndex: the index which specifies the parameter set that should be used for the filtering
 */
 inline void runProgressiveFilter(const std::valarray<float> &inputFrame,
     std::valarray<float> &outputFrame,
     const unsigned int filterIndex=0)
 {_spatiotemporalLPfilter_Irregular(get_data(inputFrame), &outputFrame[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)
	* @param inputFrame: the input image to be processed
	* @param filterIndex: the index which specifies the parameter set that should be used for the filtering
	* @return the processed image, the output is reachable later by using function getOutput() if outputFrame is NULL
	*/
	inline void runProgressiveFilter(std::valarray<double> &inputFrame, const unsigned int filterIndex=0){_spatiotemporalLPfilter_Irregular(&inputFrame[0], filterIndex);};