Probability as a function of space

1 view (last 30 days)
ailbeildce
ailbeildce on 17 Nov 2018
Edited: Miriam on 17 Nov 2018
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 Comment
Miriam
Miriam on 17 Nov 2018
Edited: Miriam on 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.

Sign in to comment.

Answers (0)

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!