how to extract data from table image?
12 次查看(过去 30 天)
显示 更早的评论
4 个评论
Benjamin Ehrlich
2021-8-18
I have experienced the OCR having a really rough time with vertical and horizontal lines...
回答(1 个)
Image Analyst
2021-8-19
You need to have at least 20 lines in the numbers for ocr() to work -- it says so in the help. Also, you can get rid of lines by thresholding and removing the largest blob, but you might want to use them to extract each rectangle one at a time so you can do ocr on just that one rectangle. If you still need help, attach a higher resolution image
2 个评论
Abdelrahman
2023-3-11
编辑:Abdelrahman
2023-3-11
Can you elaborate more how to get rid of the lines please?
Image Analyst
2023-3-11
If the lines are connected to the edge of the image you can do
mask = grayImage > somethreshold;
mask = imclearborder(mask);
otherwise, the grid looks like it would be the biggest blob in the mask you can use bwareafilt
mask = mask & ~bwareafilt(mask, 1);
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Recognition, Object Detection, and Semantic Segmentation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!