I have a cloud of points that are supposed to represent a face. I have to apply multiple times a Gaussian Filter. I tried something in Java, but it didn’t work. I think I may have proceeded wrongly. The purpose is to “fill” some empty areas.
I created a mask of n*n cells, and applied this to every point. This mask is supposed to apply the Gaussian filter considering the points inside the mask. While a mean filter works properly (but it’s not what I need), the Gaussian Filter I made is not working.
The points are on a 3D space. The question is: How would you proceed in Java to create a Gaussian Filter to apply on a cloud of Points in a 3D space ?
I actually think the solution is simple, but I guess I’m missing something. I’ve been reading everything I needed about the Gaussian Filter. So probably it’s just a Java problem the one I have.
Just in case someone else will have the same problem. I finally fiund out how to do it. It’s like applying a filter on a normal color image. But instead of having the color intensity value I have three informations x, y, z. So I have to calculate the standard deviation of the x, y, z values inside the Gauss Mask separately. Then I can calculate the Gauss weight of each cell of the mask depending on its position inside the Mask.
Finally I can calculate the new value obtained using the Gauss Mask. It’s actually really intuitive but you can improve the performance considering that you won’t need to apply the filter everywhere on your cloud of points, this would eventually corrupt the real shape of the cloud, BUT you can decide to apply the filter only in empty areas, or where spikes are located. This way you can fix holes, spikes and borders quicker.
Another suggestion, spikes can actually still be a problem even if you use a Gauss Filter. They will still have their weight inside the mask, so you would rather have holes then spikes and you can then consider only nonNull values inside the mask to generate the new x,y,z. I did it and it’s working. I tried to remove the spikes before I applied the filter. I’m sure someone can have a more elegant solution, but I hope this can still be usefull to someone.