Is there any function with same function as strel, but where I can define a center of shape not only the radius
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Eliska Paulikova
am 6 Nov. 2022
Kommentiert: Eliska Paulikova
am 7 Nov. 2022
Hello, I have a binary image, I would like to create strel function with shape of circle, but I would like to define the center of it.
So for example, I have a point where I would like the strel has a midle with define radius. Thank you so much
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 6 Nov. 2022
No such function is provided.
You will need to use strel() and then pad the array or crop the array as appropriate.
Note that structuring elements are "slid" over the entire image when in use. You would not be defining a structure element based on data (pixel) coordinates. It would be rather unusual to define a structure element that was an off-center circle (not impossible, but there is not typically any use for such a thing.)
I wonder if you are trying to use strel() to define a circle mask to use once for the entire image, rather than for morphological operations? That kind of processing would typically be done using ROI operations or by mathematical calculations.
3 Kommentare
Walter Roberson
am 7 Nov. 2022
You would typically use ROI operations for that, or mathematical calculations
D = sqrt((X-Xc).^2 + (Y-Yc).^2);
Then as you loop
mask = D <= current_radius;
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!