You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'm trying to use HoughLinesP method as follows:
Mat lines = new Mat();
HoughLinesP(mat_points, lines, 1, CV_PI / 180, 50);
IntRawIndexer linesIdx = lines.createIndexer();
for (long i = 0; i < linesIdx.rows(); i++) {
int x0 = linesIdx.get(i, 0, 0);
int y0 = linesIdx.get(i, 0, 1);
int x1 = linesIdx.get(i, 0, 2);
int y1 = linesIdx.get(i, 0, 3);
line(roi, new Point(x0, y0), new Point(x1, y1), Scalar.GREEN);
}
However, it throws the following error on this (IntRawIndexer linesIdx = lines.createIndexer();) line:
java.lang.NullPointerException: Attempt to invoke virtual method 'org.bytedeco.javacpp.BytePointer org.bytedeco.javacpp.BytePointer.capacity(long)' on a null object reference
at org.bytedeco.javacpp.helper.opencv_core$AbstractMat.createIndexer(opencv_core.java:1881)
at org.bytedeco.javacpp.helper.opencv_core$AbstractArray.createIndexer(opencv_core.java:147)
Is it a bug in the library or am I using it wrong? I tried checking if lines object is null, but it is not.
The text was updated successfully, but these errors were encountered:
How can I check if it succeeds? Lines object won't be null since I initialized it.
I managed to recreate it with cvHoughLines2 following this example. What are the differences between both of these and which method is preferred?
Actually, it looks like those functions don't accept a Mat for their outputs. I've fixed that in commit bytedeco/javacpp-presets@e1d516d. Please give it a try with 1.4.5-SNAPSHOT in a few hours when the builds are ready: http://bytedeco.org/builds/
How can I load the snapshot version with Gradle?
If I use: implementation group: 'org.bytedeco.javacpp-presets', name: 'opencv-platform', version: '4.0.1-1.4.5-SNAPSHOT'
It returns ERROR: Failed to resolve: org.bytedeco.javacpp-presets:opencv-platform:4.0.1-1.4.5-SNAPSHOT
Hello,
I'm trying to use HoughLinesP method as follows:
However, it throws the following error on this (
IntRawIndexer linesIdx = lines.createIndexer();
) line:Is it a bug in the library or am I using it wrong? I tried checking if lines object is null, but it is not.
The text was updated successfully, but these errors were encountered: