标签:
#include <cv.h> #include <highgui.h> int main(int argc, char** argv) { IplImage* src; if (((src = cvLoadImage("001.jpg", 1)) != 0)) { int x = 1000; int y = 400; int width = 400; int height = 400; int add = 50; //给定图片的从左上角(x,y) 长宽为width,height的区域进行ROI增加像素 cvSetImageROI(src, cvRect(x, y, width, height)); //增加像素 并且存储在src cvAddS(src, cvScalar(add), src); //释放基于给定矩形的ROI cvResetImageROI(src); //创建窗口 cvNamedWindow("Src", 1); //通过新建的窗口对src进行show cvShowImage("Src", src); cvWaitKey(); } return 0; }
标签:
原文地址:http://www.cnblogs.com/chenyang920/p/5345679.html