最終更新: pafuhana1213 2012年07月23日(月) 19:35:04履歴
ARUint8* = uchar*
image[ 4 * ( y * arImXsize + x ) ] = B;
image[ 4 * ( y * arImXsize + x ) + 1 ] = G;
image[ 4 * ( y * arImXsize + x ) + 2 ] = R;
image[ 4 * ( y * arImXsize + x ) + 3 ] = A;
OpenCV(cv::Mat)⇒ARToolKit
ARToolKit⇒OpenCV(cv::Mat)
参考サイト:
ARtoolkitとOpenCVの画像の変換
image[ 4 * ( y * arImXsize + x ) ] = B;
image[ 4 * ( y * arImXsize + x ) + 1 ] = G;
image[ 4 * ( y * arImXsize + x ) + 2 ] = R;
image[ 4 * ( y * arImXsize + x ) + 3 ] = A;
OpenCV(cv::Mat)⇒ARToolKit
cv::Mat matAR( matCV.rows, matCV.cols , IPL_DEPTH_8U, 4 ); cv::cvtColor( matCV, matAR, CV_BGR2BGRA ); // カラー画像 //cv::cvtColor( matCV, matAR, CV_GRAY2BGRA ); // グレイスケール画像 image = (ARUint8*)( matAR.data );
ARToolKit⇒OpenCV(cv::Mat)
cv::Mat matCV( arImYsize, arImXsize, IPL_DEPTH_8U, 4 ); memcpy( matCV.data, image, matCV.rows * matCV.cols * matCV.channels() );
参考サイト:
ARtoolkitとOpenCVの画像の変換
このページへのコメント
MjlQlU A round of applause for your blog.Really thank you! Awesome.