ROI

#include "cv.h"
#include "highgui.h"

int main(int argc,char** argv)
{
    IplImage* src;
    src = cvLoadImage("E:/opencv/1.jpg");

    int x = 250,y = 250;
    int width = 250,heigh = 250;

    int add = 200;
    cvSetImageROI(src,cvRect(x,y,width,heigh));
    cvAddS(src,cvScalar(add),src);
    cvResetImageROI(src);

    cvNamedWindow("Roi_Add",1);
    cvShowImage("Roi_Add",src);

    cvWaitKey(0);

    return 0;

}

你可能感兴趣的:(OpenCV,opencv)