Interpolation of empty area in the image
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Michal Dudek
le 24 Avr 2016
Commenté : Michal Dudek
le 25 Avr 2016
I would like to interpolate values of empty places (value == 0) in my image (as shown below) without changing the values in other places.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/162399/image.png)
I am able to create a mask of 0 and 1 with the places to interpolate, but I do not know how do the interpolation itself. I have tried roifill and imreconstruct functions, but it does not work properly for me. Function imfill also does not produce correct result as the empty places are not in closed areas.
Any ideas will be appreciated.
0 commentaires
Réponse acceptée
Image Analyst
le 24 Avr 2016
Did you try regionfill()? If your region is not closed, like the zeros go out to the edge of the image, then you might have to write in some value along the edge of the region so that there is something in the layer of pixels just outside the zero region
mask = yourImage == 0;
newImage = regionfill(yourImage, mask);
3 commentaires
Image Analyst
le 24 Avr 2016
No, roifill is kind of weird and non-intuitive - that's why they came up with regionfill(). With roifill(), you need to dilate the mask one layer with imdilate() before you can use roifill() or else it just smears in zeros. Kind of useless.
See Steve's blogs on the function: http://www.mathworks.com/search/site_search.html?q=roifill&c[]=blogs
Plus de réponses (0)
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!