英文:
Removing the entire background from a mathematical formula image
问题
我想要移除整个背景(除了积分部分),只保留积分部分。我的目的是为了从OCR中更容易地获取LaTeX格式的积分。
英文:
Consider the following image:
I would like to remove the entire background (everything that does not belong to the) to be left only with the integral. My purpose is to make it easier to get the integral in LaTeX from OCR.
答案1
得分: 1
这是您想要的吗?使用Imagemagick,我进行了除法归一化,然后进行阈值处理。
输入:
convert image.png \( +clone -blur 99 \) +swap -compose divide -composite -negate -threshold 18% -negate result.png
根据需要调整阈值。
附加操作
添加形态学操作以加粗线条
convert image.png \( +clone -blur 99 \) +swap -compose divide -composite -negate -threshold 25% -negate -morphology erode diamond:1 result.png
英文:
Is this what you want? Using Imagemagick, I do a division normalization followed by a thresholding.
Input:
convert image.png \( +clone -blur 99 \) +swap -compose divide -composite -negate -threshold 18% -negate result.png
Adjust the threshold as desired.
ADDITION
Add morphology to thicken the lines
convert image.png \( +clone -blur 99 \) +swap -compose divide -composite -negate -threshold 25% -negate -morphology erode diamond:1 result.png
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论