Problem with removing tables using Wand

23 views
Skip to first unread message

Banti Kumar

unread,
Jul 29, 2022, 4:21:47 AM7/29/22
to tesseract-ocr
I want to preprocess the image, which contains table and borders, I want to remove all the table's borders but I'm not able to completely remove it, that's why I'm getting some bad results. 


Output (After preprocessing): (Attached) The problem with output is I'm getting borders with year's header ( which is affecting on accuracy of tesseract) 

I'm removing borders by using this code (Wand library): 

with Image.from_array(img) as img_copy:
img_copy.deskew(0.4 * img_copy.quantum_range)
img_copy.type = 'grayscale'
img_copy.negate()
img_copy.artifacts['morphology:compose'] = 'darken'
img_copy.morphology(method="thinning", kernel="Rectangle:1x80+0+0<")
img_copy.negate()
image = np.asarray(img_copy, dtype='uint8')







output.PNG
Reply all
Reply to author
Forward
0 new messages