/ Published in: C++
利用一張影像當做遮罩,只顯示來源影像的一部分!
Expand |
Embed | Plain Text
void showMaskPart(const IplImage* src, const IplImage* mask, IplImage* result) { /* src is the source image which you want to mask * mask is a single channel binary image as a mask * result is the image with the same size, depth, channel with src */ cvZero(result); CvSize sz = cvSize(src->width, src->height); IplImage* refImg = cvCreateImage(sz, src->depth, src->nChannels); cvZero(refImg); cvOr(src, refImg, result, mask); cvReleaseImage(&refImg); }
You need to login to post a comment.
