Comments (6)
Right, that seems to be a bug in OpenCV... I guess we'll have to create a patch for that. Would you be able to look into this? Thanks!
from javacpp-presets.
why not.Yes i can test
from javacpp-presets.
@saudet Why do you think it is a bug in OpenCV?
I did a little experiment. The linker complains about
cv::DetectionBasedTracker::Parameters::Parameters(void)
I when to the downloaded header detection_based_tracker.hpp
and commented out constructor in struct Parameters
that was a potential problem:
struct Parameters
{
int maxTrackLifetime;
int minDetectionPeriod;
// Parameters();
};
Then I run clean
and install -projects .,opencv
. Now the build completed without errors (not counting some eror character in in comments in persistance.hpp
that I corrected too).
The thing that I do not understand is that in both cases (with and without Parameters();
commented) the generated wrapper code was almost the same. Not counting different comment and order of declarations the class for Parameters
was almost identical. Original:
@NoOffset public static class Parameters extends Pointer {
static { Loader.load(); }
public Parameters(Pointer p) { super(p); }
public Parameters(int size) { allocateArray(size); }
private native void allocateArray(int size);
@Override public Parameters position(int position) {
return (Parameters)super.position(position);
}
public native int maxTrackLifetime(); public native Parameters maxTrackLifetime(int maxTrackLifetime);
public native int minDetectionPeriod(); public native Parameters minDetectionPeriod(int minDetectionPeriod); //the minimal time between run of the big object detector (on the whole frame) in ms (1000 mean 1 sec), default=0
public Parameters() { allocate(); }
private native void allocate();
}
and with Parameters();
commented (order of declarations rearranged to match above):
public static class Parameters extends Pointer {
static { Loader.load(); }
public Parameters(Pointer p) { super(p); }
public Parameters(int size) { allocateArray(size); }
private native void allocateArray(int size);
@Override public Parameters position(int position) {
return (Parameters)super.position(position);
}
public native int maxTrackLifetime(); public native Parameters maxTrackLifetime(int maxTrackLifetime);
public native int minDetectionPeriod(); public native Parameters minDetectionPeriod(int minDetectionPeriod); //the minimal time between run of the big object detector (on the whole frame) in ms (1000 mean 1 sec), default=0
public Parameters() { allocate(); }
private native void allocate();
// Parameters();
}
The only difference is @NoOffset
annotation (no idea what that actually does).
Can we just fix the issue by commenting out Parameters();
in detection_based_tracker.hpp
? When pre-build binaries are used this should have no impact at run-time.
@jduke32 Can you check out if commenting out Parameters();
works for you?
from javacpp-presets.
@jpsacha Thanks for starting to look into this! It's a bug in OpenCV because it doesn't give us access to the cv::DetectionBasedTracker::Parameters::Parameters()
constructor defined in the .cpp file. Maybe we have to put CV_EXPORT
on the nested class as well? I'm not sure what MSVC expects, but something like that is what needs to be adjusted.
from javacpp-presets.
I create PR that adds building OpenCV binaries from source on Windows, as it is done on other platforms. Before the build two patches are applied to correct issues that were breaking creation of wrappers. One reported earlier, and one more found later. You will need to install Visual Studio 2013 (community edition works) and Windows version of CMake to generate Visual Studio project correctly.
Works fine for me, tested with some sample code from the Cookbook Examples.
from javacpp-presets.
Fix included in version 1.0. Thanks @jpsacha for the fix and the build!! 👍
from javacpp-presets.
Related Issues (20)
- PyTorch AdaptiveAvgPool2dImpl constructor HOT 2
- Missing Py*_Check Methods in JavaCPP Preset for CPython HOT 1
- [PyTorch] How to check if a tensor is None HOT 5
- arpack-ng-platform adds macosx-arm64 support HOT 3
- NegativeArraySizeException when building native image with cuda-redist using (flandmark-demo) HOT 3
- [PyTorch 2.2.2-1.5.11-SNAPSHOT] Exception java.lang.UnsatisfiedLinkError: no jnitorch in java.library.path on WIndows HOT 15
- Error trying to build android-arm HOT 3
- [PyTorch 2.2.2-1.5.11-SNAPSHOT] Training produces poor MNIST model on Windows HOT 7
- [PyTorch] Training is very slow on Linux. HOT 9
- Shaka-Packager Preset HOT 3
- [PyTorch] torch.cuda.is_bf16_supported() is missing HOT 8
- [PyTroch] torch_cuda.set_device() and torch.manual_seed() hang HOT 5
- UnsatisfiedLinkError with tesseract-platform after upgrade to 5.3.4-1.5.10 HOT 1
- ffmpeg: av_parser_parse2 missing @ByPtrPtr for poutbuf_size HOT 1
- [PyTorch] model always loaded to GPU device 0 HOT 1
- Couldn't load libjnidnnl.dylib HOT 10
- DuplicateRelativePath when build android app HOT 1
- Script Node Depth IA HOT 1
- FFmpeg random SIGSEGV calling av_dump_format on wrapper HOT 3
- why can't I found package org.bytedeco.parquet in org.bytedeco:arrow:6.0.1-1.5.8? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javacpp-presets.