-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Setting Post-Processing options using C# wrapper #6253
Comments
There was a previous case of a C# user who had an error when writing to Values when setting up decimation post-processing. https://forums.intel.com/s/question/0D50P00004D2MSBSA3/depth-postprocessing-in-%D1%81?language=en_US @dorodnic the RealSense SDK Manager offered up this alternative example in a different case, where the value is provided directly (e.g '3.0F') instead of being substituted in via an Int variable: var dec = new DecimationFilter(); |
Thank you for the swift reply. As far as I can tell the issue does not lie with the datatype used, I have tried to be mindful of that. The issue might be coming from the align filter, which I apply after the decimation filter. Could that be the issue? |
Applying the align after post-processing is the correct way to do it. Otherwise, applying align before post-processing can cause a jagged-line distortion called Aliasing. |
Applying align after post processing does seem to be the cause of the issue, as it does not occur otherwise. In some cases, but not all, it will throw an access violation exception. Can these operations not be called concurrently in the same processing block? |
There is a C# example program in the SDK that can use processing blocks to do post-processing and align. It may be worth looking through if you have not seen it already. |
Yes I have looked at this example, and I go about it in a similar way. The exception being that in the processing block I apply the decimation filter before the others. When the magnitude option of the decimation filter is changed dynamically, the problem occurs, often throwing an accessviolationexception from the call to Align. |
I did further research on this subject. As far as I know though, doing Align and post-processing together in C# can be an inherently awkward process compared to C++. Whilst aligning after post-processing is the ideal, if the program works stably for you when aligning before post-processing and does not noticeably impact image quality, it may be worth going with that and seeing if it remains stable. |
Hi Suzanne, Setting the decimation filter magnitude should be thread safe. Does this still happen if the magnitude is changed from the |
Case closed due to no further comments received. |
Issue Description
Hello!
I have recently started working with the C# wrapper for the librealsense library, and have encountered an issue that I have not yet found an answer to in your resource material.
When using the post processing functions, the only way that I have found to set the filter options is to write to the Value property directly. This is obviously not a safe way to do it, and although it does the trick in some cases, it can certainly cause critical errors.
The problem in particular is with the decimation filter. When writing to the filter magnitude option, the resulting stream will be corrupted, and occasionally an access violation exception will be thrown.
Is there anyone who can point me in the right direction as to how to resolve this?
The text was updated successfully, but these errors were encountered: