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

Ability to pad slices #311

Closed
henrygouk opened this issue Aug 31, 2016 · 7 comments
Closed

Ability to pad slices #311

henrygouk opened this issue Aug 31, 2016 · 7 comments

Comments

@henrygouk
Copy link

henrygouk commented Aug 31, 2016

The ability to pad slices could come in handy for image processing operations, among other things.

Something with similar behaviour to MATLAB's padarray function is what I am thinking of.

@henrygouk
Copy link
Author

A solution to this would also solve #291

@9il
Copy link
Member

9il commented Aug 31, 2016

Thanks!

@henrygouk
Copy link
Author

It should be possible to implement this in a way that performs the padding lazily as elements are accessed, which would be nice in the sense that allocations wouldn't be needed. This would obviously increase the number of instructions required to access elements in the padded slice, but that problem can be somewhat mitigated by calling the slice function to allocate a new slice that has the padding eagerly evaluated.

@9il
Copy link
Member

9il commented Mar 6, 2017

@henrygouk stack function was added . In combination with repeat from ndslice.topology it allows to create padding view and allocate new image with slice. Stack does not have [...] access primitives.

@9il
Copy link
Member

9il commented Mar 6, 2017

It should be possible to implement this in a way that performs the padding lazily as elements are accessed, which would be nice in the sense that allocations wouldn't be needed. This would obviously increase the number of instructions required to access elements in the padded slice, but that problem can be somewhat mitigated by calling the slice function to allocate a new slice that has the padding eagerly evaluated.

Lazy ndslice view for stack can be achieved using mir.ndslice.topology.indexed and ndiota.
See libmir/mir-algorithm#29

I will reopen this Issue for mir-cv.

@9il 9il closed this as completed Mar 6, 2017
@9il 9il mentioned this issue Mar 6, 2017
@9il
Copy link
Member

9il commented Mar 9, 2017

constant padding was added libmir/mir-algorithm#31

@9il
Copy link
Member

9il commented Mar 9, 2017

edge, symmetric and wrap paddings libmir/mir-algorithm#32

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

No branches or pull requests

2 participants