Closed GoogleCodeExporter closed 9 years ago
Please mark this as either closed or documentation.
This might be a documentation issue rather than a code issue. Further
investigation identified that this code worked with the 0.3 version and
independent install of 2.4.2. Reading the javacv_0.7 source code suggested a
change that I tried and it worked. Modifying the knnMatch statement to use a
null CvMat solves the error message problem.
Change line 74 of MatrixTest.java
from
matcherM1I1.knnMatch(matrix1,matrix2,vMatchesM1I1,1,new opencv_core.CvMat(),true);
to
matcherM1I1.knnMatch(matrix1,matrix2,vMatchesM1I1,1,null,true);
Resolves the issue.
Thanks
Original comment by pstus...@gmail.com
on 10 Mar 2014 at 9:44
Ah, I see, thanks for the update! The problem is that "new CvMat()" doesn't
actually initialize anything because it's a C struct. However, "new
CvMat(null)" does that we need because this means no memory gets allocated at
all, which forces the called function to allocate and initialize everything for
us.
In any case, I'm working on wrappers that are closer to the original C++ API:
http://code.google.com/p/javacpp/wiki/Presets
This should resolve these kinds of issues...
Original comment by samuel.a...@gmail.com
on 16 Mar 2014 at 1:01
The latest release of JavaCV 0.8 now maps the C++ API of OpenCV more closely,
so using a Mat object directly should fix this issue. There are a lot of other
changes with this release, so please make sure to read the news release here:
http://bytedeco.org/release/2014/04/28/first-release.html
Incidentally, the project is now hosted on GitHub:
https://github.com/bytedeco/javacv
Thanks for reporting!
Original comment by samuel.a...@gmail.com
on 29 Apr 2014 at 1:42
Original issue reported on code.google.com by
pstus...@gmail.com
on 7 Mar 2014 at 1:57Attachments: