Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

well you already know, that opencv != matlab, but they're using a different kernel than yours:

    float K[2][9] =
    {
        { 0, 1, 0, 1, -4, 1, 0, 1, 0 },
        { 2, 0, 2, 0, -8, 0, 2, 0, 2 }
    };
    Mat kernel(3, 3, CV_32F, K[ksize == 3]);
    if( scale != 1 )
        kernel *= scale;

    filter2D( _src, _dst, ddepth, kernel, Point(-1, -1), delta, borderType );