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

Problems with implementing PostProcessing filters #1

Open
jb455 opened this issue Aug 22, 2024 · 4 comments
Open

Problems with implementing PostProcessing filters #1

jb455 opened this issue Aug 22, 2024 · 4 comments

Comments

@jb455
Copy link

jb455 commented Aug 22, 2024

Hi!

First, thanks for sharing this wrapper, it's very useful though could do with being signposted from eg https://www.orbbec.com/developers/orbbec-sdk/, I spent a while messing around with C++ before finding this.

In my fork (https://github.com/jb455/OrbbecSDK_CSharp/tree/postprocessing) I'm trying to implement PostProcessing filters so I can use them in my project but I'm having a couple of errors when running it:

I'm guessing both are these are from how I'm initialising the Filter from the FilterList here but I'm not sure how to do it otherwise, it seems to follow the pattern used in similar cases like streamprofiles etc. Does anyone have any ideas please? Also, is the source for the C++ API available anywhere so I can see how it implements the C and emulate that for the C# wrapper?

I added a PostProcessing sample too which you can run to see the errors, though I'm not very well versed on cmake stuff so it's in as a csproj for now.

Thanks
James

@zhonghong322
Copy link
Contributor

@obwh Please take a look at this issue.

@obwh
Copy link
Contributor

obwh commented Sep 4, 2024

We will release C# SDK cover all C++ OpenOrbbecSDK API next month, thank you!

@jb455
Copy link
Author

jb455 commented Nov 26, 2024

Hi, thanks for updating this repo, it's good to see it's in active development.
I've updated my project to use the latest version (v2.0.2) and I have a couple of questions about post processing filters still.
I can use CreateRecommendedFilters to get a filter list for my device (Gemini 335) but I only get back DecimationFilter, HDRMerge, SequenceIdFilter and ThresholdFilter. I'm interested in using some of the other filters though (Spatial, Temporal and Noise Removal), does the fact that they're not on this list mean they aren't compatible or shouldn't be used with this camera? Though I can enable them all in the OrbbecViewer app.
I've started to implement the filters in the wrapper again myself but it appears a lot of the native API calls are no longer available (ie, ob_create_[x]_filter and ob_[x]_filter_set_[y]_value) though are still listed in obNative.cs. Have they moved to \extensions\filters\FilterProcessor.dll maybe? If they aren't available any more in V2, replacing create_x_filter() with create_filter(x) is ok using the filter name strings from here, but it's not obvious how to replace the get/set parameter functions. It's not clear how to use UpdateConfig in Filter.cs. Judging by how it's used in the c++ sdk eg here, it appears to need the length of the parameter array and a pointer to the first element, something like this perhaps:

SpatialAdvancedFilter spatialAdvancedFilter = new SpatialAdvancedFilter();
var spatialparams = new[] { "5", "0.7", "16000", "5" };
unsafe
{
    fixed (string* paramsPtr = &spatialparams[0])
    {
        spatialAdvancedFilter.UpdateConfig((ushort)spatialparams.Length, paramsPtr);
    }
}

but that doesn't compile as it's expecting a string, not string*.
I also tried implementing ob_filter_[get/set]_config_value but could only find a few parameter names in the c++ code here, though I get the message "Filter@NoiseRemovalFilter: config item NoiseRemovalFilter#0 doesn't exist" if I try to use it. Do you have a list of valid parameter names for all the filters I can refer to please?

If you could please point me in the right direction to solve these issues I'm happy to finish implementing all the filters and submit a PR to contribute.

Thanks
James

@zhonghong322
Copy link
Contributor

I understand what you mean,How can we use the post-processing filters that are not enabled by default in the recommended list? I will inform our C# development colleagues to take a look.

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

No branches or pull requests

3 participants