Reputation: 231
According to my research,dilation and erosion can be used to bridge the gap for a image after binarize the image.
I not sure if cvSmooth
needs to be used or not.
Upvotes: 8
Views: 14955
Reputation: 8914
Android has mostly the same functions has the documented C++/Python, so all you need to do is find which class they belong to, in this case, Imgproc:
Imgproc.erode(mInput, mInput, Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(2,2)));
Imgproc.dilate(mInput, mInput, Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(2, 2)));
Upvotes: 18
Reputation: 3988
You do have erosion and dilation in OpenCV. What you are looking for to "brige the gap" is probably what is called a closure, i.e. a dilatation followed by an erosion. It can be done using a single call to morphologyEx function. It could be an "opening", depending if you want to erode the white or black parts.
Upvotes: 4