-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[Saliency] Enable Java/Android bindings by adding 'WRAP java' to CMake #4018
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
base: 4.x
Are you sure you want to change the base?
Conversation
Fixes opencv#4016 This addresses the inability to use the `saliency` module in Android (Java/Kotlin) applications. When generated using `build_sdk.py`, the native library compiles, but the Java wrapper class (`org.opencv.saliency.Saliency`) is not generated. **Technical Fix:** The `ocv_define_module` macro in `modules/saliency/CMakeLists.txt` was missing the `java` flag in its `WRAP` parameter. **Change in `modules/saliency/CMakeLists.txt`:** # OLD ocv_define_module(saliency opencv_imgproc opencv_features2d WRAP python) # NEW ocv_define_module(saliency opencv_imgproc opencv_features2d WRAP python java)
@Akhil-Chaturvedi Please handle CI warnings. |
|
saliency: Fix -Woverloaded-virtual in header
|
@asmorkalov The Windows10-x64 job seems to have failed on a network glitch (ECONNRESET) at the very end. Could you please trigger a re-run? All other checks passed. Thanks! |
CV_WRAP void readModel(); | ||
CV_WRAP void writeModel() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The methods are not functional and are not used in the code. I propose just remove them.
Fixes #4016
This addresses the inability to use the
saliency
module in Android (Java/Kotlin) applications. When generated usingbuild_sdk.py
, the native library compiles, but the Java wrapper class (org.opencv.saliency.Saliency
) is not generated.Technical Fix:
The
ocv_define_module
macro inmodules/saliency/CMakeLists.txt
was missing thejava
flag in itsWRAP
parameter.Change in
modules/saliency/CMakeLists.txt
:OLD
ocv_define_module(saliency opencv_imgproc opencv_features2d WRAP python)
NEW
ocv_define_module(saliency opencv_imgproc opencv_features2d WRAP python java)
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.