LevelSetFilter Erode and Dilate

531 views
Skip to first unread message

Anthony Grafft

unread,
May 10, 2016, 7:02:29 PM5/10/16
to OpenVDB Forum
Hi,

I've been using Open VDB for a little while now but I'm having some issues utilizing the LevelSetFilter's erode and dilate on my levelset grids that I've been generating.  Anytime I use the erode or dilate with any number of iterations, the levelset that the filter is using has no changes applied to it.  I have made sure for erode that my halfwidth is high enough so that my background does not become 0 ( that causes a crash when I try to set the iterations too high in relation to the halfwidth ). Filters like Gaussian, Laplacian, Mean, and Mean Curveature seem to work as intended, so I would have expected the erode and dilate to work as well.

Is there something that needs to be set up to utilize Erode / Dilate through the LevelSetFilter that I'm missing? Or should I use another function to get to be able to preform an erode / dilate on my levelsets?

Thanks!
Message has been deleted

Erik Andreassen

unread,
May 13, 2016, 6:58:11 AM5/13/16
to OpenVDB Forum
Hi Anthony,

Are you using the "dilateVoxels/erodeVoxels" methods? I think these functions only changes which voxels are included in your narrowband.

What you need to do is (in this case dilating by a distance of 0.5):
 openvdb::tools::LevelSetFilter<openvdb::FloatGrid> lsf(*grid);
 lsf.offset(-0.5);


Does that answer your question? Remark though, that it is really slow.

Best,
Erik

Anthony Grafft

unread,
May 13, 2016, 1:33:33 PM5/13/16
to OpenVDB Forum
That looks like it gave me the result I was looking for. I just misunderstood what they dilate / erode methods were for. Thanks!
Reply all
Reply to author
Forward
0 new messages