I have this image Original Image:- (https://i.stack.imgur.com/O15RA.jpg) ,And after processing it above we want the following output [output image] :-(https://i.stack.imgur.com/KcA1V.jpg)
What I have tried:
int main()
{
Mat imgOffice = imread("img29.jpg");
Mat imgNoBg;
double threshold = 5; cv::inRange(imgOffice, Scalar(0, 0, 0), Scalar(50, 110, 100), imgNoBg);
cv::morphologyEx(imgNoBg, imgNoBg, cv::MORPH_CLOSE, cv::getStructuringElement(cv::MORPH_ELLIPSE, cv::Size(255, 20)));
namedWindow("image", WINDOW_NORMAL);
namedWindow("output", WINDOW_NORMAL);
imshow("image", imgOffice);
imshow("output", imgNoBg);
waitKey(0);
destroyAllWindows();
return 0;
}
I expecting this result is When I process on the original image, the output image given above should come in the same result as this.'