Skip to content

Make the "objdetect" feature enable the "dnn" and "features" features. - #725

Merged
twistedfall merged 1 commit into
twistedfall:masterfrom
de-vri-es:fix-objdetect-dependencies
Sep 17, 2026
Merged

twistedfall merged 1 commit into
twistedfall:masterfrom
de-vri-es:fix-objdetect-dependencies

Conversation

@de-vri-es

@de-vri-es de-vri-es commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

As an alternative to #724: since building the opencv crate with "objdetect" feature fails to build with the "dnn" and "features" features. The "features" module is a hard requirement, and the "dnn" module is an optional dependency. However, if the "dnn" module is enabled in the opencv build, it becomes a hard requirement too because of the way the binding generator works.

And since unavailable modules are silently ignored, it seems better to add the dependency than to omit it.

@twistedfall

Copy link
Copy Markdown
Owner

Yeah, this approach would be my first choice. But can you confirm that it solves the problems you were encountering?

@twistedfall
twistedfall merged commit 97cc4d8 into twistedfall:master Sep 17, 2026
15 checks passed
@de-vri-es

Copy link
Copy Markdown
Contributor Author

It does fix it :)

@twistedfall

Copy link
Copy Markdown
Owner

Great to hear. Then let's leave it as is, the changes in the previous PR did feel too intrusive, they would introduce another target that would need to be followed as OpenCV evolves and I try to avoid that. I'll try to prepare the new (minor) release this week.

@de-vri-es

Copy link
Copy Markdown
Contributor Author

Yeah, I agree. I was under the impression that enabling the dnn feature would make the dnn module required. But since it doesn't, this is much simpler, and less error prone :)

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