Hello,
I’m working on the background removal problem using OpenCV I’m my course work. I’ve already tried GrabCut algorithm, but I’m not satisfied with the results:
Rect rectangle = new Rect(20, 50, 397, 467);
Mat result = Mat.zeros(image.size(),CvType.CV_8U);
Mat bgdModel = Mat.zeros(1,65,CvType.CV_64F);
Mat fgdModel = Mat.zeros(1,65,CvType.CV_64F);
Imgproc.grabCut(image, result, rectangle, bgdModel, fgdModel, 2, Imgproc.GC_INIT_WITH_RECT);
Mat source = new Mat(1, 1, CvType.CV_8U, new Scalar(3));
Core.compare(result, source, result, Core.CMP_EQ);
Mat foreground = new Mat(image.size(), CvType.CV_8UC3, new Scalar(255, 255, 255));
image.copyTo(foreground, result);
In fact, it works correctly only with solid backgrounds.
What other methods could you recommend to me? I’m going to try semantic segmentation method, but maybe there are some more?