Avoid to much IO when using cvLoad [closed]
Hi.
Im trying to write a program in OpenCV (using java binding) that uses the cvLoad function.
I will be executing this row multiple times: CvHaarClassifierCascade cascade = new CvHaarClassifierCascade(cvLoad("data.xml"));
Is there someway I can exclude the IO for all the times the above is executed?
I tried to re-use and copy the pointer to the xml data and with that logic avoid the thousands of IO executions.
Pointer xmlData;
<lots of="" logic="">
private Pointer getClassifierData() {
if(xmlData != null)
{
//dont start any IO, reuse xml data, resue pointer in some form?
Pointer resusedPointer = xmlData.copyToNewPointer(); //here is what I cant figure out
} else {
xmlData = cvLoad("data.xml");
}
}
Thanks
//Fredrik
you're no more allowed to use opencv's c-api, which is dead since 2010.
if you were so unlucky to use some also unsupported 3rdparty java bindings (like javacv), using that - rethink that approach.
oh, btw, CvHaarClassifierCascade won't be able to read any recent cascade file, either
Hi.
Ok, thanks for info.
I bought a book from 2014 that still used javacv. Seems like a book I dont need :-)
//Fredrik
opencv has it's own java api (please use that !), and even javacv adapted to use c++ Mat instead of IplImages, so yea, blame that book ..