How to remove background image with Opencv
i'm new opencv . i writing a remove the background . my input image i coded my program as follow steps : - calculate average pixels //define roi of image cv::Rect roi(0, 0, 20 , 20 ); //copies input image in roi cv::Mat image_roi = imgGray( roi ); //imshow("roi", image_roi); //computes mean over roi cv::Scalar avgPixelIntensity = cv::mean( image_roi ); //prints out only .val[0] since image was grayscale cout << "Pixel intensity over ROI = " << avgPixelIntensity.val[0] << endl; -create new Mat image base on average pixels values : //create new mat image base on avgPixelIntensity cv::Mat