- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试创建一个 OCR 应用程序。我需要使用轮廓定位文本。但是,我的图像有很多噪点,我想知道是否有办法将其移除。
我当前的代码:
// Input image already converted to a matrix
Imgproc.cvtColor(matrixImage, matrixImage, Imgproc.COLOR_BGR2GRAY);
// Gaussian blur
Imgproc.GaussianBlur(matrixImage, matrixImage, new Size(7,7), 0);
Imgproc.threshold(matrixImage, matrixImage, 125, 255, Imgproc.THRESH_BINARY_INV);
// This is my current approach for removing noise. However, there is still
// a lot of random areas that can be removed.
// Remove specs from image
Mat morphingMatrix = Mat.ones(3,3, CV_8UC1);
Imgproc.morphologyEx(matrixImage, matrixImage, Imgproc.MORPH_OPEN, morphingMatrix);
// Image denoising
Photo.fastNlMeansDenoising(matrixImage, matrixImage);
我的输入图像。我允许用户手动标记角,因此下面的转换图像仅将转换应用于中间的白纸。
最佳答案
我有解决你问题的办法。但是,在这种情况下,它不涉及去除噪声。
第 1 步:
我从你上传的原图得到了我自己的变形图:
我假设您知道如何按照问题中所述对图像执行转换。尽管如此,要了解更多关于它们的信息,请访问 THIS .要了解单应投影,请访问 THIS SITE .
我得到了这张图片的灰度:
第 2 步:
对于这张图片,我使用高斯滤波器执行了自适应阈值:
第 3 步:
这一步涉及几个形态学操作:
首先,为了去除图像中不需要的 Blob ,我使用了形态学闭合操作:
其次,我使用了形态学膨胀操作(除非您想突出显示文本,否则您可能不需要):
关于java - OpenCV - 使用 Java 去除图像中的噪声,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41675245/
给定一个字符串"5 900 000" 我想通过以下模式使用 gsub 去除空格: gsub(/\s/, '') 但这似乎行不通。也没有: gsub(' ', '') 最佳答案 如果你想就地替换,你需要
我编写了一个程序来抓取网站以获取数据并输出到 Excel 表。该程序使用 Microsoft Visual Studio 2010 用 C# 编写。 大多数时候,我从网站获取内容、解析内容并将数据存储
在 MS Access 2007 项目报告中,我有以下(已编辑)查询: SELECT SomeCol FROM SomeTable 问题是, SomeCol 显然包含一些不可见的字符。例如,我看到一个
如 Removing left recursion 中所述,有两种方法可以去除左递归。 使用一些过程修改原始语法以删除左递归 写文法原来没有左递归 人们通常使用什么来删除(没有)ANTLR 的左递归?
我在 CoreData 中存储了一堆艺术家,并希望按名称对它们进行排序,但忽略前缀“the”。例如,“The Beatles”将被排序为“Beatles”,有点像 iTunes/iPod 的做法。 因
我有一个 WebView ,我想从中删除弹性。现在,当滚动小于 webview 的页面时,它会产生弹性效果,显示下面的背景。我想删除这个。 我尝试过执行以下操作,但没有成功。它找到了 WebDynam
我正在调查我们公司使用 Prometheus 从我们在 Kubernetes 上运行的实验中收集统计数据。有计划使用标签来标记我们的云/集群中特定实验的名称。这意味着我们将生成大量标签,这些标签会随着
我正在添加聚合物元素。我想在单击其(自己的)图像时删除元素(自我)。根据封装,我将不得不让 parent 删除 child 。但这也需要为母体生成聚合物元素(我在这里吗??)。 children.ad
现在如果我点击按钮 A,按钮 B 会显示 DropShadow 效果: Private Sub ButtonA_Click(ByVal sender As System.Object, ByVal
我尝试过这个,但它对我不起作用: char * remove_nl(char * newstr) { newstr = strdup(newstr); newstr[strlen(ne
我陷入了两难境地。我有一个图像,我想占据网页的背景。我希望它横跨屏幕的宽度和高度,并保持那个尺寸。当我使用 标签,我不知道如何将它拉伸(stretch)到没有白条的屏幕上。 wspace 和 hspa
Jade .foo .foo 结果 想要的结果 在 haml 中我会做类似 .foo>< 的事情但这在 Jade 中不起作用。我已经搜索并空手而归如何处理这个问题。我如何达到预期的结果
我是 Maven 的新手,当我尝试将我当前的项目从使用 Ant 转换为 -> 使用 Maven 时遇到了问题。 那个项目需要很多 Jar,我在 mvnrepository 上查找这些 jar 并将它们
我需要一个正则表达式来删除 xml 标记开头和结尾之间的空格。例如:有人创建 xml 并将其发送给我,这样我就可以验证、签名并发送到网络服务。 为此,我需要删除标签开头和结尾之间的空格: String
我写了几个方法来将项目添加到数组中,如果它们已经在数组中,它们将被忽略。在对数据结构做了一些研究之后,我意识到我可以通过简单地将它们放在一个集合中来摆脱重复(特别是因为我不关心对象的顺序)。然而,在玩
使用 HighCharts,我想移除 SVG 曲线上的抗锯齿。 到目前为止,我正在使用这个: $('path').each(function(i,j){$(j).attr('shape-renderi
由于某些奇怪的原因(黑色但不是黑色部分),我的 SeekBar 和拇指后面出现随机阴影。我该如何摆脱它? 我的搜索栏: 拇指.xml progress_appearance.xml(有一些
我有一个 Url,我想获取路径部分但没有尾随文件名。如果 Url 是 http://my.com/dir1/dir2/file.ext 那么我想获取 /dir1/dir2 . 我已经尝试了各种拆分(l
我有这个字符串: dataSourceURL = URL(string:"https://api.abc.com/api/p4/products?pid=uid8225&format=json&off
在我的网页中,我有一个菜单 (HorizontalPanel) 应该隐藏在页面的底部。为此,我尝试使用 RootLayoutPanel 类并在其中添加一个 south 小部件,我成功地做到了。但问
我是一名优秀的程序员,十分优秀!