Probability as a function of space
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Sorry for the bad title, I couldn't articulate better.
Let's say I have an image 512 x 512. I want to populate this image with 0's and 1's, generally decaying according to their distance from the origin (256, 256). If this was a deterministic process, I would do something like:
A = zeros(512, 512);
A(256, 256) = 1;
B = bwdist(A);
and threshold B at some radius. However, I want to have some 1's in the edges as well, but generally, I'd like to have 1's around the center (and some few 0's around the center) and mostly 0's around the edges/corners. I ideally would like to have blobs instead of independent points switching between 0 and 1 (i.e. if by luck a 1 appears near corners, it should have a few spatially close 1's around it too), but I think if I can get a start on this problem, I can get to that.
Thank you!
1 commentaire
Miriam
le 17 Nov 2018
Modifié(e) : Miriam
le 17 Nov 2018
Try this answer (https://www.mathworks.com/matlabcentral/answers/35861-how-to-sample-from-custom-2d-distribution#answer_45071), using something like a Gaussian distribution, to get the initial points without blobs. Maybe if you make a new probablitiy distribution using this first pass you could use the same function to get your blobs.
Réponses (0)
Voir également
Catégories
En savoir plus sur Image Processing Toolbox 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!