Ask Your Question
0

Print MatOfKeyPoint in a text file

asked 2014-11-11 13:32:52 -0600

Kinn gravatar image

updated 2014-11-12 03:30:10 -0600

berak gravatar image

Hi guys, At the first, sorry for my bad english. I'm a student and I'm trying to develop an application with the Android version of OpenCV. I need some information about the structure and the methods to manipulate MatOfKeyPoint Object.

I don't understand so good the structure of Keypoints and MatOfKeyPoint, however I need to "print" the MatOfKeyPoints of certain image in a text file but I don't understand how to do it.

Can you explain me what functions can I use to do it?

Here there is the dedicated JavaDoc: Java API)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-11-12 03:41:16 -0600

berak gravatar image

MatOfKeyPoint has a toArray() function, the output from that is nicely printable:

KeyPoint a = new KeyPoint(3,3,3);
KeyPoint b = new KeyPoint(4,4,4);

MatOfKeyPoint mfk = new MatOfKeyPoint(a,b);

System.err.println(mfk.toArray());

KeyPoint [pt={3.0, 3.0}, size=3.0, angle=-1.0, response=0.0, octave=0, class_id=-1]
KeyPoint [pt={4.0, 4.0}, size=4.0, angle=-1.0, response=0.0, octave=0, class_id=-1]
edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-11-11 13:32:52 -0600

Seen: 344 times

Last updated: Nov 12 '14