目标:我想在2D平面上创建随机的非重叠不规则的圆形形状(轮廓),类似于砂岩微结构,如下所示,以使用计算机视觉进行油泛洪实验。
方法:我以前做过类似的事情,但具有圆形而不是随机形状。结果如下。
另外,我知道创建封闭。
帮助:,但我无法将这两个步骤结合到一个脚本中。另外,如果还有其他替代方案,则非常欢迎。
代码:
-
- href =“ https://stackoverflow.com/a/50732357/13162534”> bezier曲线
Objective: I want to create random non-overlapping irregular rounded shapes (contours) on a 2D plane, similar to a sandstone microstructure as shown below, to perform an oil flooding experiment using computer vision.

Approach: I have previously done a similar thing but with circular shapes instead of random shapes. The result is as below.

Also, I am aware of the programming way of creating closed Bezier curves.
Help: But I am not able to combine both these steps into a single script. Also if there are any other alternatives it is more than welcome.
Code:
-
Circular Shapes inside 2D plane
-
Bezier Curves
发布评论
评论(1)
我在此处从Extimentanest的答案中获取了大部分代码:使用matplotlib 。需要进行一些微调来收紧随机形状之间的空间,但基本思想是有
一个随机生成的结果:
I took most of the code from ImportanceOfBeingErnest's answer here: Create random shape/contour using matplotlib. Some fine-tuning is needed to tighten the space between the random shapes but the basic idea is there
A random generated result:
