$ for i in $(seq 10 10 90) ; do convert rose: -threshold $i% rose$i.png; done
import open3d
import numpy
from PIL import Image
pcd = open3d.geometry.PointCloud()
files = ['rose10.png','rose20.png','rose30.png','rose40.png','rose50.png','rose60.png','rose70.png','rose80.png','rose90.png']
for fileId in range(len(files)) :
im = numpy.array(Image.open(files[fileId]).convert('L'))
gy = (im > 1)*1
for i in range(len(gy)):
for j in range(len(gy[i])):
if ( gy[i][j] == 1) :
pcd.points.append([ j, i, fileId])
pcd.colors.append([ 0.1*fileId, 0, 0]);
voxel = open3d.geometry.VoxelGrid.create_from_point_cloud(pcd, 1)
open3d.visualization.draw_geometries(
[voxel],
width=400,
height=400,
point_show_normal = True
)