Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

differences betweek java and c++

Hi, I have done a morphology operation Top Hat on one image, in C++, and the result is a little different than the morphology operation Top Hat from OpenCV on Java. Is it possible that the OpenCV 248 for Java may be different than the OpenCV 248 for C++?

I did

cv::Mat ker = cv::Mat::ones(17, 17, CV_8UC1);
cv::morphologyEx(img, img, cv::MORPH_TOPHAT, ker);

and in Java it is

final Mat kernel = Mat.ones(17, 17, CvType.CV_8UC1);
final Mat dst = new Mat(img.size(), img.type());
Imgproc.morphologyEx(img, dst, Imgproc.MORPH_TOPHAT, kernel);