Reputation: 199
So I am working on image recognition with Java and OpenCV, but I am stuck trying to convert the Arraylist back into a MatOfKeyPoint.
List<KeyPoint> newList = new ArrayList<KeyPoint>(points.subList(0, 500));
So I need to convert the newList back to a MatofKeyPoint. Any ideas?
Upvotes: 2
Views: 1207
Reputation: 14044
MatOfKeyPoint has a fromList
method
MatOfKeyPoint kp = new MatOfKeyPoint();
kp.fromList(newList);
for stuff like this, be sure to have a peek at the relevant javadocs :)
Upvotes: 2