Reimplement Saturation visualizer as a shader pass - #162
Merged
Conversation
Reflects that in this case it's always a saturation shader pass rather than a generic shader pass
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses comments in #139 and aims to remove camera preview visualization latency by replacing the CV saturation preview with a shader pass similar to what was implemented before the refactor.
The shader used is exactly the same but is now done in a new operator
SaturationShaderPassthat is inserted afterStoreImagein the ImGui pipeline. This allows the shader pass to follow the same architecture as the rest of the Bonsai.ImGui operators and removes the need to use a visualizer mapping in construction of the full ImGui visualization.For now,
SaturationShaderPassis responsible only for this particular shader, but the structure here could probably be extended to allow generic 'one-shot' shader passes to be added to images in the ImGui pipeline.Note that I was not able to test this on a camera with acquisition rate >200Hz. At this rate I did not see any latency but can;t be sure it won't exist for higher frame rates. I did notice that the image rotation (which is done in CV) could sometimes introduce transient delays but could not confirm this was the culprit vs. data throughput on the machine I'm using for testing. We can rethink the rotation approach if this continues to cause issues.