selvinEduardo / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

Passing Java vectors to @StdVector #406

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm relatively new to JavaCV, and I want to manually call groupRectanges.  I 
have an array of CvRect objects, and I cannot figure out how to pass them to 
the groupRectangles function.  Could I please get a very small snippet of code 
that will compile

// This does not compile
CvRect[] rects = new CvRect[1];
IntPoint rweights = new IntPointer(1);

groupRectangles(rects, rweights, 3, 0.2);

What is the expected output? What do you see instead?
It seems like the @StdVector annotation should be used to convert my Java array 
to a C++ std::vector<>, but
that doesn't seem to be happening.

What version of the product are you using? On what operating system?
I'm using version 0.6 on Mac

Please provide any additional information below.

Original issue reported on code.google.com by jonmo...@gmail.com on 10 Jan 2014 at 8:19

GoogleCodeExporter commented 9 years ago
Java annotations don't do that no. We have to use the types of the parameters, 
e.g.:
    CvRect rects = new CvRect(1);
    IntPointer rweights = new IntPointer(1);
    groupRectangles(rects, rweights, 3, 0.2);

Please post your questions on the mailing list if possible, thank you!

Original comment by samuel.a...@gmail.com on 11 Jan 2014 at 9:56