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

Bug: Unable to create Spatial Filter #18

Open
jb455 opened this issue Nov 6, 2024 · 7 comments
Open

Bug: Unable to create Spatial Filter #18

jb455 opened this issue Nov 6, 2024 · 7 comments

Comments

@jb455
Copy link

jb455 commented Nov 6, 2024

An exception is thrown when creating a spatial filter with the code:
auto spatialFilter = std::make_shared<ob::SpatialAdvancedFilter>();
The message given is:
Invalid filter name, cannot find filter creator for filter name: SpatialAdvancedFilter

Tested with precompiled release 2.0.18.0 and latest commit to main on this repo (d6d044a), using a Gemini 336 on FW 1.3.70.

Note that it is possible to enable the filter using the Orbbec Viewer app (V2.0.18-main) without error.

Just out of interest I tried replacing "SpatialAdvancedFilter" with "SpatialFilter" at

if(filterFactory->isFilterCreatorExists("SpatialAdvancedFilter")) {
(and the following line) and it appears to fix the issue but I don't know if that will cause problems elsewhere.

@hzcyf
Copy link
Contributor

hzcyf commented Nov 6, 2024

Thanks for the feedback, can you confirm that you have copied the extensions libraries to your application working directory?Perhaps this is due to the SDK not successfully finding and loading the extensions libraries.

Additional information:Extensions libraries can be found in the lib directory of the precompiled package

@hzcyf hzcyf self-assigned this Nov 6, 2024
@jb455
Copy link
Author

jb455 commented Nov 6, 2024

Hi, thanks for the quick reply.
I do have the extensions libraries in my output directory - to confirm, we should maintain the /extensions/... structure, and not have all the libraries copied to the root output directory?

I added the auto spatialfilter... line to the ob_depth sample and met the same error as in my code, you could try that to replicate the bug yourself (I'm assuming the samples have all libraries added correctly).

@jb455
Copy link
Author

jb455 commented Nov 6, 2024

I just realised I get the same error when trying to initialise ob::NoiseRemovalFilter, ob::DisparityTransform and ob::TemporalFilter the same way too, though ob::DecimationFilter and ob::HdrMerge work.
Is the only intended way to get filters to go via sensor->createRecommendedFilters()? We want to enable filters and set parameters individually in our app, it would be possible to loop through the FilterList and pick out which filters we are interested in but feels like a bit of a hack.

@hzcyf
Copy link
Contributor

hzcyf commented Nov 6, 2024

image
I used precompiled release v2.0.18 to add the code you mentioned and tested it without problems.


There is one piece of information that we haven't updated the documentation on: for commercial reasons, some filters are tied to our devices and need to be created after a device or pipeline created. This may be the cause of your problem.

@hzcyf
Copy link
Contributor

hzcyf commented Nov 6, 2024

Hi, thanks for the quick reply. I do have the extensions libraries in my output directory - to confirm, we should maintain the /extensions/... structure, and not have all the libraries copied to the root output directory?

I added the auto spatialfilter... line to the ob_depth sample and met the same error as in my code, you could try that to replicate the bug yourself (I'm assuming the samples have all libraries added correctly).

Just keep the /extensions/... structure.

@jb455
Copy link
Author

jb455 commented Nov 6, 2024

There is one piece of information that we haven't updated the documentation on: for commercial reasons, some filters are tied to our devices and need to be created after a device or pipeline created. This may be the cause of your problem.

Ah, that fixed it, I just moved filter initialisation to after pipeline start. Thanks for your help!

@jb455 jb455 closed this as completed Nov 6, 2024
@hzcyf
Copy link
Contributor

hzcyf commented Nov 6, 2024

OK, glad to hear it's fixed. This is still an oversight in our documentation and interface comments, and we'll add a description of it in the next release before we close this issue.

@hzcyf hzcyf reopened this Nov 6, 2024
@hzcyf hzcyf added the Docs label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants