You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
You are most definitely right: The delta parameter is missing, and as a result, the value 1 (the BORDER_REPLICATE macro) is being used for it and BORDER_DEFAULT for borderType.
Great spotting, thanks!
The consequence is a constant value being added to all the pixels, which doesn't really have any meaningful effect for our case. The fix is just adding delta as zero, i.e.: Sobel(blurred, dx, dx.type(), 1, 0, 7, 1, 0, BORDER_REPLICATE); Sobel(blurred, dy, dy.type(), 0, 1, 7, 1, 0, BORDER_REPLICATE);
C++ is not to blame though; blame me for my inattentiveness and OpenCV for not using a proper scoped enumeration for the parameter :-)
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:
but the interface to cv::Sobel() is:
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 missingdelta
parameter. In OpenCV (3.4.2 at least),BORDER_DEFAULT
is 1 (which means the value ofdelta
being used here is 1), and theborderType
being used isBORDER_DEFAULT
, notBORDER_REPLICATE
.The text was updated successfully, but these errors were encountered: