TI Correspondent,
I am working with an LCDK C6748, and have started a bare metal (i.e. no RTSC or SYS/BIOS) application aimed at doing some simple image processing. Basing my project in part on the FaceDetect demo, given that I am familiar with OpenCV, I added "cv.lib" and "cxcore.lib" to my linker path, and the "cv*.h" and "cx*.h" headers to my compiler include path. I wrote a MWE program that simply tries to allocate an image handle object as follows:
// Hardware libraries #include <cv.h> #include <cvtypes.h> static IplImage* cv = NULL; void main(void) { // Allocate the Ipl Image structure cv = (IplImage *) cvAlloc(sizeof(IplImage)); // Initialize the Ipl Image cvInitImageHeader(*cv, cvSize(1024, 768), IPL_DEPTH_8U, 3, IPL_ORIGIN_BL, 8); }
This sequence of actions is the same that is seen at the start of the FaceDetect demo for the colorConvertTask() thread. The cvAlloc() function executes without issue, and allocates the IplImage structure to the heap as expected. The cvInitImageHeader() function, however, immediately fails and calls an abort, with the following error text seen over the debugger:
[C674X_0] Assertion failed, (0), file C:/opencv_dsp/cxcore/src/cxerror.cpp, line 373
The only other information available from the debug session is a (somewhat unhelpful) call stack (screenshot pasted below). All of the functions in the call stack are related to an abort operation, which makes sense given that an assertion failed.
Am I missing a required startup step to use the OpenCV libraries? Does it require the use of RSTC or SYS/BIOS? If there is some dependency on RSTC or SYS/BIOS, is there a means of emulating the required functionality in bare metal?
Thanks,
-Chris F.