我在摩擦学样本上进行图像处理。我是从图像中分割磨损轨迹,但有一个反复出现的问题:
将阈值设置得太低会导致完全失败。将其设置得太高(如图中所示)会导致多个区域几乎完全被标签包围。他们搞砸了我用来估计轨道宽度的距离变换,应该检测并合并到标签上。
我使用形态学操作来提高标签的质量,但由于图像其余部分的某些副作用,我不希望使结构元素变大。标签的曲率使我无法使用凸包。标签的大部分使我无法使用标签的坚固性作为指标。不需要的内部物体不会被标签完全包裹,因此无法通过欧拉特征等检测到它们。
有没有什么好方法可以检测几乎完全'的背景物体。被前景物体包围?
答案 0 :(得分:2)
我使用Private Sub bwExportFinish_DoWork(sender As Object, e As DoWorkEventArgs) Handles bwExportFinish.DoWork
Dim ExportList As List(Of Object) = TryCast(e.Argument, List(Of Object))
If ExportList Is Nothing Then
' Casting has failed. Choose how you want to handle this.
End If
'Dim APP As Excel.Application = TryCast(ExportList(0), Excel.Application)
'Or you can skip the casting if you already know you passed the right object.
Dim APP As Excel.Application = ExportList(0)
Dim workbook As Excel.Workbook = ExportList(1)
Dim worksheet As Excel.Worksheet = ExportList(2)
Dim worksheetRange As Excel.Range = ExportList(3)
Dim status As String = ExportList(4)
'Save spreadsheet
workbook.SaveAs(SavePath)
workbook.Close(False)
APP.Quit()
End Sub
将背景分成不同的区域,然后watershed
来检测区域的边界与前景对象共享多少:
bwboundaries