Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

BaseRowFilter and BaseColumnFilter in opencv 3.x

I have some old code which I would like to use/port:

template<typename T, typename ST> struct RowSum : public BaseRowFilter
{
    RowSum( int _ksize, int _anchor )
    {
        ksize = _ksize;
        anchor = _anchor;
    }

    void operator()(const uchar* src, uchar* dst, int width, int cn)
    {
        const T* S = (const T*)src;
        ST* D = (ST*)dst;
        int i = 0, k, ksz_cn = ksize*cn;

        width = (width - 1)*cn;
        for( k = 0; k < cn; k++, S++, D++ )
        {
            ST s = 0;
            for( i = 0; i < ksz_cn; i += cn )
                s += S[i];
            D[0] = s;
            for( i = 0; i < width; i += cn )
            {
                s += S[i + ksz_cn] - S[i];
                D[i+cn] = s;
            }
        }
    }
};

but apparently the BaseRowFilter and BaseColumnFilter classes are not public available anymore. Is there any way to bypass this restriction and make the above struct to work again as before?

I found a kind of similar question here by @wuling. So I do not know if @berak has any idea or if @wuling managed to find a workaround. Thanks.