文章

顯示從 5月, 2011 起發佈的文章

Map Mat and IplImage | 連結Mat和IplImage

Because of using mat as mask filter, so I map mat to IplImage. The code below are IplImage to mat and mat to IplImage. Because those are pointer pointing to the same address,  they will affect the value. 因為打算用mat做mask filter的關系,所以要連結IplImage和mat。 以下的方法是 mat to iplimage 和 iplimage to mat。因為指向同一地址,所以任何一方作改變都會改變原始的數值。 //IplImage to Mat IplImage *img; cv::Mat mat(img, 0); //Mat to IplImage cv::Mat mat; IplImage *img = new IplImage(mat);