Effacer les filtres
Effacer les filtres

How to insert a disc and centered around the dot?

2 vues (au cours des 30 derniers jours)
Sara
Sara le 10 Fév 2020
Commenté : Sara le 10 Fév 2020
Hi,
I have A = zeros(100,100) materix which I added a while pixel (dots) in this zeros materix randomly. I have also another disc materix as follows
disk = strel('disk', 10);
D = disk.Neighborhood;
what I want to do is insert the disc and centered around the pixel ( white pixel)

Réponse acceptée

Walter Roberson
Walter Roberson le 10 Fév 2020
A(appropriate_row:appropriate_row+99, appropriate_column:appropriate_column+99) = ...
A(appropriate_row:appropriate_row+99, appropriate_column:appropriate_column+99) | D;
  3 commentaires
Walter Roberson
Walter Roberson le 10 Fév 2020
The +99 should be +9
Protection needs to be added for the case that the location is near an edge.
Sara
Sara le 10 Fév 2020
Thank you for your reply. I did fix this as you says. it should be less than the disc raduis which is 10 in my case.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Computer Vision with Simulink dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by