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

Add a method for pixel size in sophus::ImageView #181

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

wylderkeane
Copy link
Contributor

The ImageView::sizeBytes() method uses the original ImageLayout structure when using subview() results in an inaccurate calculation for the size of the subview. The ImageLayout needs be the same in the subview to enable proper indexing into the subview, but this results in calculating the size in bytes incorrectly for the subview. This method exposes the pixel size so it can be calculated correctly for the subview when necessary.

Without this method it's difficult to calculate the actual size in bytes
of subviews because they normally inherit the layout from the parent
image, which has a pitch_bytes indicating the full width times pixel
size.

This simplifies that to expose the pixel size directly.
@wylderkeane wylderkeane merged commit fbf7380 into main Oct 9, 2023
13 checks passed
@wylderkeane wylderkeane deleted the add-pixel-size-method branch October 9, 2023 22:27
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

Successfully merging this pull request may close these issues.

2 participants