Arian Sajid
Arian Sajid

Reputation: 11

Removing Unwanted blob in image

How can i remove unwanted blob from this image so that only text area is visible in the image?Image with unwanted blob

Upvotes: 0

Views: 105

Answers (1)

Pedro Marques
Pedro Marques

Reputation: 175

If what you are looking for is always text, I suggested first applying an OCR to recognize the text.

I=imread('image'jpg');
ocrResults   = ocr(image);
Iocr         = insertObjectAnnotation(image, 'rectangle', ...
                       ocrResults.WordBoundingBoxes, ...
                       ocrResults.WordConfidences);
figure; imshow(Iocr);

And the result should be something like this: Iocr

After you apply OCR, in the variable ocrResults you will have a field that will be CharacterBoundingBoxes, where through this you can create a binary mask of ones (on the position of the boxes) and erase everything else (zeros). Of course some noise will be detected as text, but if you work a bit with morphological operations as explained above (bwareaopen) you will have better results.

Upvotes: 1

Related Questions