for (i = 0; i < nPersons; i++) {
String varname = "personName_" + (i + 1);
cvWriteString(
fileStorage, // fs
varname, // name
personNames.get(i), // string
0); // quote
}
I’m trying to use openCV to do some facial recognition. This is part of code that I’ve found from javaCV sample.
The compiler always complains about :
The method cvWriteString(opencv_core.CvFileStorage, String, String, int) in the type opencv_core is not applicable for the arguments (opencv_core.CvFileStorage, String, Object, int)
Can anyone help me? Thank you
personNames.get(i) returns an object, not a String. You have to cast it to let the compiler know you’ll be passing a String in.
Try this: