Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

handling camera buffer

In my project i already have camera output in a buffer ProcessFrames(unsigned char *RefFrame,unsigned char *CurrentFrame, int width,int height) // i need to do processing on frames

IplImage *ReferenceImage = cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,1);
IplImage *CurrentImage     = cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,1);
IplImage *ResultImage       = cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,1);

cvSetData( ReferenceImage, RefFrame, width );
cvSetData( CurrentImage, CurrentFrame, width );  //here already create image header has allocated size so what is the reason for the crash

after core dump i get the message

OpenCV Error: Bad argument (Unknown array type) in cvarrToMat Downloads/opencv-2.4.7/modules/core/src/matrix.cpp, line 698 terminate called after throwing an instance of 'cv::Exception' what(): Downloads/opencv-2.4.7/modules/core/src/matrix.cpp:698: error: (-5) Unknown array type in function cvarrToMat

handling camera buffer

In my project i already have camera output in a buffer ProcessFrames(unsigned char *RefFrame,unsigned char *CurrentFrame, int width,int height) // i need to do processing on frames

IplImage *ReferenceImage = cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,1);
IplImage *CurrentImage     = cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,1);
IplImage *ResultImage       = cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,1);

cvSetData( ReferenceImage, RefFrame, width );
cvSetData( CurrentImage, CurrentFrame, width );  //here already create image header has allocated size so what is the reason for the crash
crash 
//finally i do this 

    cvReleaseImageHeader(&ReferenceImage);
   cvReleaseImageHeader(&CurrentImage);

after core dump i get the message

OpenCV Error: Bad argument (Unknown array type) in cvarrToMat Downloads/opencv-2.4.7/modules/core/src/matrix.cpp, line 698 terminate called after throwing an instance of 'cv::Exception' what(): Downloads/opencv-2.4.7/modules/core/src/matrix.cpp:698: error: (-5) Unknown array type in function cvarrToMat

click to hide/show revision 3
coded intended properly

handling camera buffer

In my project i already have camera output in a buffer

ProcessFrames(unsigned char *RefFrame,unsigned char *CurrentFrame, int width,int height) // i need to do processing on frames

{
    IplImage *ReferenceImage = cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,1);
 IplImage *CurrentImage     = cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,1);
 IplImage *ResultImage       = cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,1);
    // my camera input is Grey so i keep all at same depth 
    cvSetData( ReferenceImage, RefFrame, width );
 cvSetData( CurrentImage, CurrentFrame, width );  //here already create image header has allocated size so // fine until here 

cvAbsDiff(ReferenceImage, CurrentImage, ResultImage);

// here is the culprit for crash
// can somebody point what is the reason for the crash going wrong here

//finally i do this

    cvReleaseImageHeader(&ReferenceImage);
 cvReleaseImageHeader(&CurrentImage);
    cvReleaseImageHeader(&ResultImage);

} after core dump i get the message

OpenCV Error: Bad argument (Unknown array type) in cvarrToMat Downloads/opencv-2.4.7/modules/core/src/matrix.cpp, line 698 terminate called after throwing an instance of 'cv::Exception' what(): Downloads/opencv-2.4.7/modules/core/src/matrix.cpp:698: error: (-5) Unknown array type in function cvarrToMat

handling camera buffer

In my project i already have camera output in a buffer

ProcessFrames(unsigned char *RefFrame,unsigned char *CurrentFrame, int width,int height) { height)

{

IplImage *ReferenceImage = cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,1);
 IplImage *CurrentImage     = cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,1);
 IplImage *ResultImage       = cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,1);
 

// my camera input is Grey so i keep all at same depth cvSetData( ReferenceImage, RefFrame, width ); cvSetData( CurrentImage, CurrentFrame, width ); // fine until here

cvAbsDiff(ReferenceImage, CurrentImage, ResultImage);

ResultImage); // here is the culprit for crash
// can somebody point what is going wrong here

here

//finally i do this

    cvReleaseImageHeader(&ReferenceImage);
cvReleaseImageHeader(&CurrentImage);
    cvReleaseImageHeader(&ResultImage);

} after core dump i get the message

OpenCV Error: Bad argument (Unknown array type) in cvarrToMat Downloads/opencv-2.4.7/modules/core/src/matrix.cpp, line 698 terminate called after throwing an instance of 'cv::Exception' what(): Downloads/opencv-2.4.7/modules/core/src/matrix.cpp:698: error: (-5) Unknown array type in function cvarrToMat

click to hide/show revision 5
retagged

updated 2013-11-26 02:44:00 -0600

berak gravatar image

handling camera buffer

In my project i already have camera output in a buffer

ProcessFrames(unsigned char *RefFrame,unsigned char *CurrentFrame, int width,int height)

{

IplImage *ReferenceImage = cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,1);
IplImage *CurrentImage     = cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,1);
IplImage *ResultImage       = cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,1);

// my camera input is Grey so i keep all at same depth cvSetData( ReferenceImage, RefFrame, width ); cvSetData( CurrentImage, CurrentFrame, width ); // fine until here

cvAbsDiff(ReferenceImage, CurrentImage, ResultImage); 
       // here is the culprit for crash  
      // can somebody point what is going wrong here

//finally i do this

    cvReleaseImageHeader(&ReferenceImage);
cvReleaseImageHeader(&CurrentImage);
    cvReleaseImageHeader(&ResultImage);

} after core dump i get the message

OpenCV Error: Bad argument (Unknown array type) in cvarrToMat Downloads/opencv-2.4.7/modules/core/src/matrix.cpp, line 698 terminate called after throwing an instance of 'cv::Exception' what(): Downloads/opencv-2.4.7/modules/core/src/matrix.cpp:698: error: (-5) Unknown array type in function cvarrToMat

click to hide/show revision 6
No.6 Revision

handling camera buffer

In my project i already have camera output in a buffer

ProcessFrames(unsigned char *RefFrame,unsigned char *CurrentFrame, int width,int height)

{

height)
{
IplImage *ReferenceImage = cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,1);
 IplImage *CurrentImage = cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,1);
 IplImage *ResultImage = cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,1);

// my camera input is Grey so i keep all at same depth cvSetData( ReferenceImage, RefFrame, width ); cvSetData( CurrentImage, CurrentFrame, width ); // fine until here

 cvAbsDiff(ReferenceImage, CurrentImage, ResultImage);
  // here is the culprit for crash
  // can somebody point what is going wrong here
here
//finally i do this
cvReleaseImageHeader(&ReferenceImage);
cvReleaseImageHeader(&CurrentImage);
cvReleaseImageHeader(&ResultImage);
}

//finally i do this

    cvReleaseImageHeader(&ReferenceImage);
cvReleaseImageHeader(&CurrentImage);
    cvReleaseImageHeader(&ResultImage);

} after core dump i get the message

OpenCV Error: Bad argument (Unknown array type) in cvarrToMat
Downloads/opencv-2.4.7/modules/core/src/matrix.cpp, line 698
terminate called after throwing an instance of 'cv::Exception'
what(): Downloads/opencv-2.4.7/modules/core/src/matrix.cpp:698: error: (-5) Unknown array type in function cvarrToMat

cvarrToMat