Converting cv::Mat to IplImage*

前端 未结 8 1107
庸人自扰
庸人自扰 2020-11-28 22:51

The documentation on this seems incredibly spotty.

I\'ve basically got an empty array of IplImage*s (IplImage** imageArray) and I\'m calling a function to import an

相关标签:
8条回答
  • 2020-11-28 23:32

    Personaly I think it's not the problem caused by type casting but a buffer overflow problem; it is this line

    cvCopy(iplimagearray[i], xyz);   
    

    that I think will cause segment fault, I suggest that you confirm the array iplimagearray[i] have enough size of buffer to receive copyed data

    0 讨论(0)
  • 2020-11-28 23:32

    In case of gray image, I am using this function and it works fine! however you must take care about the function features ;)

    CvMat * src=  cvCreateMat(300,300,CV_32FC1);      
    IplImage *dist= cvCreateImage(cvGetSize(dist),IPL_DEPTH_32F,3);
    
    cvConvertScale(src, dist, 1, 0);
    
    0 讨论(0)
提交回复
热议问题