2D data line completion
1 次查看(过去 30 天)
显示 更早的评论
Hello there,
So here is the problem I have (picture attached).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/155108/image.png)
As you can see the data can be roughly presented by lines which are not straight but will cover the general behaviour of not too big divination.
What I need to to is to fill the gaps in between them (currently interested in the region with highest intensity (represented in yellow). What I could do is to filter it by intensity at the moment to create something like that:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/155110/image.png)
Which is fantastic as everything apart from the region of interest is 0.
Does anyone however happen to know a clever way of filling the gaps as I said.
Thanks
0 个评论
回答(1 个)
Brattv
2016-2-16
编辑:Brattv
2016-2-16
The binary morphology operation called closing might be good enought if everything apart from the ROI is 0. You can try it with the line shaped filter and test different length
% strel('line',line length, line angle)
Morphfilt = strel('line',1000,0);
yourImage = imclose(yourImage,Morphfilt);
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!