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

Question: Why have EventImage2D be a const-only container? #28

Open
twongjirad opened this issue Aug 23, 2018 · 0 comments
Open

Question: Why have EventImage2D be a const-only container? #28

twongjirad opened this issue Aug 23, 2018 · 0 comments
Labels

Comments

@twongjirad
Copy link
Contributor

Any reason to enforce this?

Here is my current use case that would require the underlying vector to be mutable. this would mean allowing an as_vector() command that doesnt pass a const reference.

I have a routine to crop a whole event image into many subimages (162), whose meta do not change, event-by-event. The need to allocate and reallocate the eventimage2d vector is inefficient. it would seem better to keep the images in memory, and just update the values. (of course, this also requires that iomanager does not clear the event container after writing it -- which is another question i guess.)

I do see that one could create two vector and swap them from event to event using eventimage::emplace. but for large vectors of images, that's double the memory.

maybe better yet is to just make eventimage2d inheret from both eventbase and std::vectorlarcv::Image2D.

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

No branches or pull requests

1 participant