Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Incorrect calls to cv::Sobel() in PuRe? #1

@steven807

Description

@steven807

It is hard to be sure with C++ being as unsafe as it is, but it looks like the two calls to cv::Sobel() take one too few arguments. They look like:

Sobel(blurred, dx, dx.type(), 1, 0, 7, 1, BORDER_REPLICATE);
Sobel(blurred, dy, dy.type(), 0, 1, 7, 1, BORDER_REPLICATE);

but the interface to cv::Sobel() is:

Sobel( InputArray src, OutputArray dst, int ddepth,
                         int dx, int dy, int ksize = 3,
                         double scale = 1, double delta = 0,
                         int borderType = BORDER_DEFAULT );

Note that the borderType parameter is in the 8th position, but the calls in PuRe.cpp put it at the 7th position. I'm guessing that there is a missing delta parameter. In OpenCV (3.4.2 at least), BORDER_DEFAULT is 1 (which means the value of delta being used here is 1), and the borderType being used is BORDER_DEFAULT, not BORDER_REPLICATE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions