Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GrowCutGenerator does not work for a single slice. #5

Open
JamesAPetts opened this issue Jan 13, 2020 · 2 comments
Open

GrowCutGenerator does not work for a single slice. #5

JamesAPetts opened this issue Jan 13, 2020 · 2 comments

Comments

@JamesAPetts
Copy link
Member

I've observed that GrowCut does not work for a single slice, the labelmap/strengthmaps do not change between iterations. I assume this is because the center is [x/2,y/2,0], and the latter coordinate means that no fragment in the shader pases this block:?

if (any( lessThan( neighborIndex, ivec3(0,0,0) ) ) ||

It must be a flooring issue, but I would expect the value in the shader to be 0.5 in the z direction for all voxels in the single frame sized texture any ideas @pieper?

Do we need a special 2D routine to deal with this edge case?
This is likely true for the core step library also.

@pieper
Copy link
Member

pieper commented Jan 13, 2020

I would have thought that loop would still work - the line you linked would just continue for the out-of-plane neighbors but the rest ought to work.

Maybe it's this line - the size might end up as (columns, rows, 0) but it should be (columns, rows, 1)

ivec3 texelIndex = ivec3(floor(interpolatedTextureCoordinate * vec3(size)));

@JamesAPetts
Copy link
Member Author

Good spot, that could be it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants