在Python中,我使用的是erode,如下所示:
#include <iostream>
#include <string>
#include <regex>
using namespace std;
int main() {
regex pattern{R"(\d{2}|thanks)"};
string to_search = "I would like the number 98 to be found and printed, thanks.";
smatch matches;
regex_search(to_search, matches, pattern);
for (auto match : matches) {
cout << match << endl;
}
return 0;
}
在C ++中,我使用它作为:
result = cv2.erode(image, None)
然而他们给出了不同的结果?他们在Python和C ++之间的OpenCV3中有不同的默认值