/ Published in: C++

利用一張影åƒç•¶åšé®ç½©ï¼Œåªé¡¯ç¤ºä¾†æºå½±åƒçš„一部分ï¼
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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); }
Comments
