A sizable issue

After making the video work with the voxelization, an issue arose. Resizing did not work properly with videos which caused errors in the voxelizing algorithm. I narrowed it down to the calculation of the resizing factor which gave an incorrect value. I realized that the resizing factor that I got from my method was only valid if the solid was centered which was not necessarily the case for a video as it is the centering vector is the same for every obj file.

After finding where the issue came from, correcting it was not hard. Considering r_max the max radius of the object, z_min and z_max the max and min for z-axis values in the obj file and H and R the height and radius of LitSpin, i only needed to change the resizing factor from max(|z_max – z_min|/H, r_max/R) to max(2*|z_max|/H, 2*|z_min|/H, r/R) which gave a factor that would not be dependent on the object being centered.

The next task was to make processing a video faster. The animation we used was 36 frames long and voxelizing the obj files took 2 minutes on my computer. Using the Qt thread pool class, I could process 4 files at a time and since each process is independent, making voxelizing a video almost 4 faster at 35 seconds for the same animation.

Leave a Reply

Your email address will not be published. Required fields are marked *