To create a dataset for deep learning, I need to produce gray-scale images like this:
To give you a context, it is droplet passing light. There I four features I need to produce which have been specified by a number:
- Backround - usually a shade of gray
- A light halo around the droplet
- A dark shadow
- A focused light
#3&4 could get thinner or wider or lighter and darker.
The shape of the droplet is a small deviation from the sphere.
My idea was to make randomly-deviated curve from a circle like this:
H = 10
rho = np.random.rand(H)*np.logspace(-0.5,-2.5,H)
phi = np.random.rand(H)* 2*np.pi
t = np.linspace(0,2*np.pi,101)
r = np.ones(len(t))
for h in range(H):
r = r + rho[h]*np.sin(h*t+phi[h])
x = r * np.cos(t)
y = r * np.sin(t)
I need to create three closed curves and fill them with solid color and add a blur effect. Is it possible to do this in matplotlib? Can I use an equation to specify a contour in OpenCV and then do those operations?
