Skip to content

Update OpenCV/JavaCPP, reduce warnings#2017

Merged
petebankhead merged 2 commits intoqupath:mainfrom
petebankhead:javacpp
Oct 24, 2025
Merged

Update OpenCV/JavaCPP, reduce warnings#2017
petebankhead merged 2 commits intoqupath:mainfrom
petebankhead:javacpp

Conversation

@petebankhead
Copy link
Member

Update to use OpenCV 4.11.0 and JavaCPP 1.5.12.

This removes a warning on launch about JavaCPP versions being inconsistent (caused by TensorFlow pulling in a more recent JavaCPP version than we were using for OpenCV).

Also, remove use of Gson.setLenient() to remove more startup warnings.

Finally, update QP.getCurrentServer() to return ImageServer<BufferedImage> instead of ImageServer<?>. This didn't cause warnings on startup, but it could cause annoyances when trying to write scripts in an IDE.

Update to use OpenCV 4.11.0 and JavaCPP 1.5.12.

This removes a warning on launch about JavaCPP versions being inconsistent (caused by TensorFlow pulling in a more recent JavaCPP version than we were using for OpenCV).

Also, remove use of `Gson.setLenient()` to remove more startup warnings.

Finally, update `QP.getCurrentServer()` to return `ImageServer<BufferedImage>` instead of `ImageServer<?>`. This didn't cause warnings on startup, but it could cause annoyances when trying to write scripts in an IDE.
@petebankhead petebankhead added this to the v0.7.0 milestone Oct 24, 2025
This was failing on Windows, but passing on macOS.

The OpenCV docs suggest that meanStdDev should not be used for more than 4 channels; that didn't appear to be related to the problem that caused the failing tests, but now we extract channels anyway to try to ensure the results are reliable.
@petebankhead petebankhead merged commit d0db3d7 into qupath:main Oct 24, 2025
3 checks passed
@petebankhead petebankhead deleted the javacpp branch October 24, 2025 18:03
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.

1 participant