Cleaning the edges of an image

asked 2019-03-01 01:51:52 -0500

Nett-kun gravatar image

updated 2019-03-01 16:52:51 -0500

I am making a document scanner app and I have extracted the document using edge detection and cropping it. But I need the document image to be clean for page segmentation purposes. I want to clean the black edges on the borders of the image. Is there a way to do that? I just used this for the cropping and the edge detection of the image and for binarization i used opencv's adaptive thresholding

adaptiveThreshold(mgGray, adaptive_mean, 255, CV_ADAPTIVE_THRESH_MEAN_C, CV_THRESH_BINARY, 25, 10);

Original Image: image description

Here is the sample image after binarizing: image description

edit retag flag offensive close merge delete


please add the original image and the code you used.

sturkmen gravatar imagesturkmen ( 2019-03-01 01:58:39 -0500 )edit

I've updated my question

Nett-kun gravatar imageNett-kun ( 2019-03-01 16:49:24 -0500 )edit