在 OpenCV 中,填充一個矩形的代碼:
cvRectangle(iplImage,
cvPoint(pElement->rect.left, pElement->rect.top),
cvPoint(pElement->rect.left+pElement->rect.width, pElement->rect.top+pElement->rect.height),
color,
CV_FILLED,
8, 0);
有人問啦,如果吾不想填充,隻畫邊怎麼辦?把CV_FILLED(-1)換成其他值(比如說2),就可以了。