Probability as a function of space

1 次查看(过去 30 天)
ailbeildce
ailbeildce 2018-11-17
编辑: Miriam 2018-11-17
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 个评论
Miriam
Miriam 2018-11-17
编辑:Miriam 2018-11-17
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by