Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Convert String to Mat Java

I have a String saved that is full with Keypoints, but I need to use this string in the descriptor, which only takes Mat. I've been looking online, and they said to make it into a vector (which I did) that can be converted to a Mat. On other sites I then read that this isn't possible. How can I change my String to a Mat?

Convert String to Mat Java

I have a String saved that is full with Keypoints, but I need to use this string in the descriptor, which only takes Mat. I've been looking online, and they said to make it into a vector (which I did) that can be converted to a Mat. On other sites I then read that this isn't possible. How can I change my String to a Mat?

 String log = cn.getKeyPoints(); 
Vector<String> v1 = new Vector<String>(Arrays.asList(log));

Convert String to Mat Java

I have a String saved that is full with Keypoints, but I need to use this string in the descriptor, which only takes Mat. I've been looking online, and they said to make it into a vector (which I did) that can be converted to a Mat. On other sites I then read that this isn't possible. How can I change my String to a Mat?

 String log = cn.getKeyPoints(); 
Vector<String> v1 = new Vector<String>(Arrays.asList(log));

The string contains the next information

[KeyPoint [pt={123.0, 164.0}, size=7.0, angle=-1.0, response=214.0, octave=0, class_id=-1], KeyPoint [pt={212.0, 170.0}, size=7.0, angle=-1.0, response=201.0, octave=0, class_id=-1], KeyPoint [pt={59.0, 116.0}, size=7.0, angle=-1.0, response=200.0, octave=0, class_id=-1], KeyPoint [pt={296.0, 133.0}, size=7.0, angle=-1.0, response=199.0, octave=0, class_id=-1]

So if I could just change it from the String to the Mat, that would be perfect

Convert String to Mat Java

I have a String saved that is full with Keypoints, but I need to use this string in the descriptor, which only takes Mat. I've been looking online, and they said to make it into a vector (which I did) that can be converted to a Mat. On other sites I then read that this isn't possible. How can I change my String to a Mat?

 String log = cn.getKeyPoints(); 
Vector<String> v1 = new Vector<String>(Arrays.asList(log));

The string contains the next information

[KeyPoint "[KeyPoint [pt={123.0, 164.0}, size=7.0, angle=-1.0, response=214.0, octave=0, class_id=-1], KeyPoint [pt={212.0, 170.0}, size=7.0, angle=-1.0, response=201.0, octave=0, class_id=-1], KeyPoint [pt={59.0, 116.0}, size=7.0, angle=-1.0, response=200.0, octave=0, class_id=-1], KeyPoint [pt={296.0, 133.0}, size=7.0, angle=-1.0, response=199.0, octave=0, class_id=-1]
class_id=-1]";

So if I could just change it from the String to the Mat, that would be perfect

Convert String to Mat Java

I have a String saved that is full with Keypoints, but I need to use this string in the descriptor, which only takes Mat. I've been looking online, and they said to make it into a vector (which I did) that can be converted to a Mat. On other sites I then read that this isn't possible. How can I change my String to a Mat?

 String log = "[KeyPoint [pt={123.0, 164.0}, size=7.0, angle=-1.0, response=214.0, octave=0, class_id=-1], KeyPoint [pt={212.0, 170.0}, size=7.0, angle=-1.0, response=201.0, octave=0, class_id=-1], KeyPoint [pt={59.0, 116.0}, size=7.0, angle=-1.0, response=200.0, octave=0, class_id=-1], KeyPoint [pt={296.0, 133.0}, size=7.0, angle=-1.0, response=199.0, octave=0, class_id=-1]";

So if I could just change it from the String to the Mat, that would be perfect