Hi
I’ve an image form pointcloud which is sparse, Using UNet can be an issue because there will not be many points in its window.
Its pixel values are basically classes. e.g. [3,4]=11 where pixel 3,4 has class 11.
My image looks like
If it is important that the output pixels have classes drawn from the input labels, perhaps you could use a nearest-neighbor interpolation. Assuming your pointcloud is stored as an array of points[N, 3] where the first two columns are the coordinates and points[1:end, 3] are the labels:
using Interpolations
itp = interpolate(
(points[1:end, 1], points[1:end, 2]),
points[1:end, 3],
(Gridded(Constant()), Gridded(Constant())))
# itp can be queried by (x,y) to retrieve the class at a particular position,
# perhaps in a loop to generate an output image at a desired resolution.
itp(5.5, 6.3)